summaryrefslogtreecommitdiffstats
path: root/src/IndentHandler.cpp
diff options
context:
space:
mode:
authorMichele Calgaro <michele.calgaro@yahoo.it>2022-07-16 15:44:05 +0900
committerMichele Calgaro <michele.calgaro@yahoo.it>2022-07-16 15:44:05 +0900
commita30a266067d9d952edc91305bef757557c03717e (patch)
tree7bcabd84594f751001c66b16f3c42a8d459b7773 /src/IndentHandler.cpp
parentd017bd37253ae35b29d82e3277b9adcbb4517dd0 (diff)
downloaduniversal-indent-gui-tqt-a30a266067d9d952edc91305bef757557c03717e.tar.gz
universal-indent-gui-tqt-a30a266067d9d952edc91305bef757557c03717e.zip
Raw Qt->TQt conversion using tde/scripts/conversions/qt3-tqt3/convert_existing_qt3_app_to_tqt3.
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
Diffstat (limited to 'src/IndentHandler.cpp')
-rwxr-xr-xsrc/IndentHandler.cpp546
1 files changed, 273 insertions, 273 deletions
diff --git a/src/IndentHandler.cpp b/src/IndentHandler.cpp
index 2446fa3..23f47f8 100755
--- a/src/IndentHandler.cpp
+++ b/src/IndentHandler.cpp
@@ -25,31 +25,31 @@
#include "UiGuiIniFileParser.h"
#include "SettingsPaths.h"
-#include <tqtoolbox.h>
+#include <tntqtoolbox.h>
#include <tqvboxlayout.h>
-#include <tqapplication.h>
-#include <tqcheckbox.h>
-#include <tqcombobox.h>
-#include <tqtoolbutton.h>
-#include <tqfile.h>
-#include <tqprocess.h>
-#include <tqsettings.h>
-#include <tqstringlist.h>
-#include <tqlineedit.h>
-#include <tqspinbox.h>
-#include <tqlabel.h>
+#include <tntqapplication.h>
+#include <tntqcheckbox.h>
+#include <tntqcombobox.h>
+#include <tntqtoolbutton.h>
+#include <tntqfile.h>
+#include <tntqprocess.h>
+#include <tntqsettings.h>
+#include <tntqstringlist.h>
+#include <tntqlineedit.h>
+#include <tntqspinbox.h>
+#include <tntqlabel.h>
#include <tqbytearray.h>
-#include <tqdir.h>
-#include <tqmessagebox.h>
-#include <tqmainwindow.h>
-#include <tqtextstream.h>
-#include <tqtextcodec.h>
+#include <tntqdir.h>
+#include <tntqmessagebox.h>
+#include <tntqmainwindow.h>
+#include <tntqtextstream.h>
+#include <tntqtextcodec.h>
#include <tqtscript.h>
#include <tqdesktopservices.h>
#include <tqmenu.h>
-#include <tqaction.h>
+#include <tntqaction.h>
#include <tqcontextmenuevent.h>
-#include <tqfiledialog.h>
+#include <tntqfiledialog.h>
#include <tqtdebug.h>
#ifdef Q_OS_WIN32
@@ -81,7 +81,7 @@ inline void UNUSED_PARAMETER_WARNING_AVOID(T){}
its \a indenterID, which is the number of found indenter ini files in alphabetic
order starting at index 0.
*/
-IndentHandler::IndentHandler(int indenterID, QWidget *mainWindow, QWidget *parent) : QWidget(parent)
+IndentHandler::IndentHandler(int indenterID, TQWidget *mainWindow, TQWidget *parent) : TQWidget(parent)
, _indenterSelectionCombobox(NULL)
, _indenterParameterHelpButton(NULL)
, _toolBoxContainerLayout(NULL)
@@ -99,7 +99,7 @@ IndentHandler::IndentHandler(int indenterID, QWidget *mainWindow, QWidget *paren
{
Q_ASSERT_X( indenterID >= 0, "IndentHandler", "the selected indenterID is < 0" );
- setObjectName(QString::fromUtf8("indentHandler"));
+ setObjectName(TQString::fromUtf8("indentHandler"));
_mainWindow = mainWindow;
@@ -111,43 +111,43 @@ IndentHandler::IndentHandler(int indenterID, QWidget *mainWindow, QWidget *paren
connect( _actionResetIndenterParameters, SIGNAL(triggered()), this, SLOT(resetIndenterParameter()) );
// define this widgets resize behavior
- setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding );
+ setSizePolicy( TQSizePolicy::Expanding, TQSizePolicy::Expanding );
// create vertical layout box, into which the toolbox will be added
- _toolBoxContainerLayout = new QVBoxLayout(this);
+ _toolBoxContainerLayout = new TQVBoxLayout(this);
_toolBoxContainerLayout->setMargin(2);
// Create horizontal layout for indenter selector and help button.
- QHBoxLayout *hboxLayout = new QHBoxLayout();
+ TQHBoxLayout *hboxLayout = new TQHBoxLayout();
//hboxLayout->setMargin(2);
_toolBoxContainerLayout->addLayout( hboxLayout );
// Create the indenter selection combo box.
- _indenterSelectionCombobox = new QComboBox(this);
- _indenterSelectionCombobox->setSizeAdjustPolicy(QComboBox::AdjustToMinimumContentsLengthWithIcon);
+ _indenterSelectionCombobox = new TQComboBox(this);
+ _indenterSelectionCombobox->setSizeAdjustPolicy(TQComboBox::AdjustToMinimumContentsLengthWithIcon);
_indenterSelectionCombobox->setMinimumContentsLength(20);
connect( _indenterSelectionCombobox, SIGNAL(activated(int)), this, SLOT(setIndenter(int)) );
UiGuiSettings::getInstance()->registerObjectProperty(_indenterSelectionCombobox, "currentIndex", "selectedIndenter");
hboxLayout->addWidget( _indenterSelectionCombobox );
// Create the indenter parameter help button.
- _indenterParameterHelpButton = new QToolButton(this);
- _indenterParameterHelpButton->setObjectName(QString::fromUtf8("indenterParameterHelpButton"));
- _indenterParameterHelpButton->setIcon(QIcon(QString::fromUtf8(":/mainWindow/help.png")));
+ _indenterParameterHelpButton = new TQToolButton(this);
+ _indenterParameterHelpButton->setObjectName(TQString::fromUtf8("indenterParameterHelpButton"));
+ _indenterParameterHelpButton->setIcon(TQIcon(TQString::fromUtf8(":/mainWindow/help.png")));
hboxLayout->addWidget( _indenterParameterHelpButton );
// Handle if the indenter parameter help button is pressed.
connect( _indenterParameterHelpButton, SIGNAL(clicked()), this, SLOT(showIndenterManual()) );
// create a toolbox and set its resize behavior
- _indenterParameterCategoriesToolBox = new QToolBox(this);
- _indenterParameterCategoriesToolBox->setObjectName(QString::fromUtf8("_indenterParameterCategoriesToolBox"));
+ _indenterParameterCategoriesToolBox = new TQToolBox(this);
+ _indenterParameterCategoriesToolBox->setObjectName(TQString::fromUtf8("_indenterParameterCategoriesToolBox"));
#ifdef UNIVERSALINDENTGUI_NPP_EXPORTS
connect( _indenterParameterCategoriesToolBox, SIGNAL(currentChanged(int)), this, SLOT(updateDrawing()) );
#endif // UNIVERSALINDENTGUI_NPP_EXPORTS
- //_indenterParameterCategoriesToolBox->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding );
- //_indenterParameterCategoriesToolBox->setMaximumSize(QSize(16777215, 16777215));
+ //_indenterParameterCategoriesToolBox->setSizePolicy( TQSizePolicy::Expanding, TQSizePolicy::Expanding );
+ //_indenterParameterCategoriesToolBox->setMaximumSize(TQSize(16777215, 16777215));
// insert the toolbox into the vlayout
_toolBoxContainerLayout->addWidget(_indenterParameterCategoriesToolBox);
@@ -157,7 +157,7 @@ IndentHandler::IndentHandler(int indenterID, QWidget *mainWindow, QWidget *paren
_indenterDirctoryStr = SettingsPaths::getIndenterPath();
_tempDirctoryStr = SettingsPaths::getTempPath();
_settingsDirctoryStr = SettingsPaths::getSettingsPath();
- QDir indenterDirctory = QDir(_indenterDirctoryStr);
+ TQDir indenterDirctory = TQDir(_indenterDirctoryStr);
if ( _mainWindow != NULL ) {
_errorMessageDialog = new UiGuiErrorMessage(_mainWindow);
@@ -166,7 +166,7 @@ IndentHandler::IndentHandler(int indenterID, QWidget *mainWindow, QWidget *paren
_errorMessageDialog = new UiGuiErrorMessage(this);
}
- _indenterIniFileList = indenterDirctory.entryList( QStringList("uigui_*.ini") );
+ _indenterIniFileList = indenterDirctory.entryList( TQStringList("uigui_*.ini") );
if ( _indenterIniFileList.count() > 0 ) {
// Take care if the selected indenterID is smaller or greater than the number of existing indenters
if ( indenterID < 0 ) {
@@ -193,7 +193,7 @@ IndentHandler::IndentHandler(int indenterID, QWidget *mainWindow, QWidget *paren
}
}
else {
- _errorMessageDialog->showMessage(tr("No indenter ini files"), tr("There exists no indenter ini files in the directory \"") + QDir(_indenterDirctoryStr).absolutePath() + "\".");
+ _errorMessageDialog->showMessage(tr("No indenter ini files"), tr("There exists no indenter ini files in the directory \"") + TQDir(_indenterDirctoryStr).absolutePath() + "\".");
}
retranslateUi();
@@ -205,7 +205,7 @@ IndentHandler::IndentHandler(int indenterID, QWidget *mainWindow, QWidget *paren
*/
IndentHandler::~IndentHandler() {
// Generate the parameter string that will be saved to the indenters config file.
- QString parameterString = getParameterString();
+ TQString parameterString = getParameterString();
if ( !_indenterFileName.isEmpty() ) {
saveConfigFile( _settingsDirctoryStr + "/" + _indenterFileName + ".cfg", parameterString );
}
@@ -219,24 +219,24 @@ IndentHandler::~IndentHandler() {
*/
void IndentHandler::initIndenterMenu() {
if ( _menuIndenter == NULL ) {
- _actionLoadIndenterConfigFile = new QAction(this);
- _actionLoadIndenterConfigFile->setObjectName(QString::fromUtf8("_actionLoadIndenterConfigFile"));
- _actionLoadIndenterConfigFile->setIcon(QIcon(QString::fromUtf8(":/mainWindow/load_indent_cfg.png")));
+ _actionLoadIndenterConfigFile = new TQAction(this);
+ _actionLoadIndenterConfigFile->setObjectName(TQString::fromUtf8("_actionLoadIndenterConfigFile"));
+ _actionLoadIndenterConfigFile->setIcon(TQIcon(TQString::fromUtf8(":/mainWindow/load_indent_cfg.png")));
- _actionSaveIndenterConfigFile = new QAction(this);
- _actionSaveIndenterConfigFile->setObjectName(QString::fromUtf8("_actionSaveIndenterConfigFile"));
- _actionSaveIndenterConfigFile->setIcon(QIcon(QString::fromUtf8(":/mainWindow/save_indent_cfg.png")));
+ _actionSaveIndenterConfigFile = new TQAction(this);
+ _actionSaveIndenterConfigFile->setObjectName(TQString::fromUtf8("_actionSaveIndenterConfigFile"));
+ _actionSaveIndenterConfigFile->setIcon(TQIcon(TQString::fromUtf8(":/mainWindow/save_indent_cfg.png")));
- _actionCreateShellScript = new QAction(this);
- _actionCreateShellScript->setObjectName(QString::fromUtf8("_actionCreateShellScript"));
- _actionCreateShellScript->setIcon(QIcon(QString::fromUtf8(":/mainWindow/shell.png")));
+ _actionCreateShellScript = new TQAction(this);
+ _actionCreateShellScript->setObjectName(TQString::fromUtf8("_actionCreateShellScript"));
+ _actionCreateShellScript->setIcon(TQIcon(TQString::fromUtf8(":/mainWindow/shell.png")));
- _actionResetIndenterParameters = new QAction(this);
- _actionResetIndenterParameters->setObjectName(QString::fromUtf8("_actionResetIndenterParameters"));
- _actionResetIndenterParameters->setIcon(QIcon(QString::fromUtf8(":/mainWindow/view-refresh.png")));
+ _actionResetIndenterParameters = new TQAction(this);
+ _actionResetIndenterParameters->setObjectName(TQString::fromUtf8("_actionResetIndenterParameters"));
+ _actionResetIndenterParameters->setIcon(TQIcon(TQString::fromUtf8(":/mainWindow/view-refresh.png")));
- _menuIndenter = new QMenu(this);
- _menuIndenter->setObjectName(QString::fromUtf8("_menuIndenter"));
+ _menuIndenter = new TQMenu(this);
+ _menuIndenter->setObjectName(TQString::fromUtf8("_menuIndenter"));
_menuIndenter->addAction(_actionLoadIndenterConfigFile);
_menuIndenter->addAction(_actionSaveIndenterConfigFile);
_menuIndenter->addAction(_actionCreateShellScript);
@@ -248,7 +248,7 @@ void IndentHandler::initIndenterMenu() {
/*!
\brief Returns the context menu used for some actions like saving the indenter config file.
*/
-QMenu* IndentHandler::getIndenterMenu() {
+TQMenu* IndentHandler::getIndenterMenu() {
return _menuIndenter;
}
@@ -256,8 +256,8 @@ QMenu* IndentHandler::getIndenterMenu() {
/*!
\brief Returns the actions of the context menu used for some actions like saving the indenter config file.
*/
-QList<QAction*> IndentHandler::getIndenterMenuActions() {
- QList<QAction*> actionList;
+TQList<TQAction*> IndentHandler::getIndenterMenuActions() {
+ TQList<TQAction*> actionList;
actionList << _actionLoadIndenterConfigFile << _actionSaveIndenterConfigFile << _actionCreateShellScript << _actionResetIndenterParameters;
return actionList;
}
@@ -266,7 +266,7 @@ QList<QAction*> IndentHandler::getIndenterMenuActions() {
/*!
\brief Opens the context menu, used for some actions like saving the indenter config file, at the event position.
*/
-void IndentHandler::contextMenuEvent( QContextMenuEvent *event ) {
+void IndentHandler::contextMenuEvent( TQContextMenuEvent *event ) {
getIndenterMenu()->exec( event->globalPos() );
}
@@ -275,18 +275,18 @@ void IndentHandler::contextMenuEvent( QContextMenuEvent *event ) {
\brief Creates the content for a shell script that can be used as a external tool call
to indent an as parameter defined file.
*/
-QString IndentHandler::generateShellScript(const QString &configFilename) {
- QString indenterCompleteCallString;
- QString parameterInputFile;
- QString parameterOuputFile;
- QString parameterParameterFile;
- QString replaceInputFileCommand;
+TQString IndentHandler::generateShellScript(const TQString &configFilename) {
+ TQString indenterCompleteCallString;
+ TQString parameterInputFile;
+ TQString parameterOuputFile;
+ TQString parameterParameterFile;
+ TQString replaceInputFileCommand;
// Define the placeholder for parameter variables either in batch or bash programming.
#if defined(Q_OS_WIN32)
- QString shellParameterPlaceholder = "%1";
+ TQString shellParameterPlaceholder = "%1";
#else
- QString shellParameterPlaceholder = "$1";
+ TQString shellParameterPlaceholder = "$1";
#endif
parameterInputFile = " " + _inputFileParameter + "\"" + shellParameterPlaceholder + "\"";
@@ -345,13 +345,13 @@ QString IndentHandler::generateShellScript(const QString &configFilename) {
}
#if defined(Q_OS_WIN32)
- QString shellScript( TemplateBatchScript::getTemplateBatchScript() );
+ TQString shellScript( TemplateBatchScript::getTemplateBatchScript() );
shellScript = shellScript.replace("__INDENTERCALLSTRING2__", indenterCompleteCallString + "\n" + replaceInputFileCommand);
indenterCompleteCallString = indenterCompleteCallString.replace("%1", "%%G");
replaceInputFileCommand = replaceInputFileCommand.replace("%1", "%%G");
shellScript = shellScript.replace("__INDENTERCALLSTRING1__", indenterCompleteCallString + "\n" + replaceInputFileCommand);
#else
- QString shellScript( TemplateBatchScript::getTemplateBatchScript() );
+ TQString shellScript( TemplateBatchScript::getTemplateBatchScript() );
shellScript = shellScript.replace("__INDENTERCALLSTRING2__", indenterCompleteCallString + "\n" + replaceInputFileCommand);
indenterCompleteCallString = indenterCompleteCallString.replace("$1", "$file2indent");
replaceInputFileCommand = replaceInputFileCommand.replace("$1", "$file2indent");
@@ -368,7 +368,7 @@ QString IndentHandler::generateShellScript(const QString &configFilename) {
The \a inputFileExtension has to be given as parameter so the called indenter
can identify the programming language if needed.
*/
-QString IndentHandler::callIndenter(QString sourceCode, QString inputFileExtension) {
+TQString IndentHandler::callIndenter(TQString sourceCode, TQString inputFileExtension) {
if ( _indenterExecutableSuffix == ".js" ) {
return callJavaScriptIndenter(sourceCode);
}
@@ -384,19 +384,19 @@ QString IndentHandler::callIndenter(QString sourceCode, QString inputFileExtensi
The \a inputFileExtension has to be given as parameter so the called indenter
can identify the programming language if needed.
*/
-QString IndentHandler::callJavaScriptIndenter(QString sourceCode) {
- QScriptEngine engine;
+TQString IndentHandler::callJavaScriptIndenter(TQString sourceCode) {
+ TQScriptEngine engine;
engine.globalObject().setProperty("unformattedCode", sourceCode);
- QFile jsDecoderFile( _indenterExecutableCallString );
- QString jsDecoderCode;
- if (jsDecoderFile.open(QFile::ReadOnly)) {
+ TQFile jsDecoderFile( _indenterExecutableCallString );
+ TQString jsDecoderCode;
+ if (jsDecoderFile.open(TQFile::ReadOnly)) {
jsDecoderCode = jsDecoderFile.readAll();
}
jsDecoderFile.close();
- QScriptValue value = engine.evaluate(jsDecoderCode);
+ TQScriptValue value = engine.evaluate(jsDecoderCode);
return value.toString();
}
@@ -407,7 +407,7 @@ QString IndentHandler::callJavaScriptIndenter(QString sourceCode) {
The \a inputFileExtension has to be given as parameter so the called indenter
can identify the programming language if needed.
*/
-QString IndentHandler::callExecutableIndenter(QString sourceCode, QString inputFileExtension) {
+TQString IndentHandler::callExecutableIndenter(TQString sourceCode, TQString inputFileExtension) {
Q_ASSERT_X( !_inputFileName.isEmpty(), "callIndenter", "_inputFileName is empty" );
// Q_ASSERT_X( !_outputFileName.isEmpty(), "callIndenter", "_outputFileName is empty" );
Q_ASSERT_X( !_indenterFileName.isEmpty(), "callIndenter", "_indenterFileName is empty" );
@@ -416,16 +416,16 @@ QString IndentHandler::callExecutableIndenter(QString sourceCode, QString inputF
return "";
}
- QString formattedSourceCode;
- QString indenterCompleteCallString;
- QString parameterInputFile;
- QString parameterOuputFile;
- QString parameterParameterFile;
- QProcess indentProcess;
- QString processReturnString;
+ TQString formattedSourceCode;
+ TQString indenterCompleteCallString;
+ TQString parameterInputFile;
+ TQString parameterOuputFile;
+ TQString parameterParameterFile;
+ TQProcess indentProcess;
+ TQString processReturnString;
// Generate the parameter string that will be saved to the indenters config file
- QString parameterString = getParameterString();
+ TQString parameterString = getParameterString();
if ( !_globalConfigFilename.isEmpty() ) {
saveConfigFile( _tempDirctoryStr + "/" + _globalConfigFilename, parameterString );
@@ -437,13 +437,13 @@ QString IndentHandler::callExecutableIndenter(QString sourceCode, QString inputF
}
// Delete any previously used input src file and create a new input src file.
- QFile::remove(_tempDirctoryStr + "/" + _inputFileName + inputFileExtension);
- QFile inputSrcFile(_tempDirctoryStr + "/" + _inputFileName + inputFileExtension);
+ TQFile::remove(_tempDirctoryStr + "/" + _inputFileName + inputFileExtension);
+ TQFile inputSrcFile(_tempDirctoryStr + "/" + _inputFileName + inputFileExtension);
// Write the source code to the input file for the indenter
- if ( inputSrcFile.open( QFile::ReadWrite | QFile::Text ) ) {
+ if ( inputSrcFile.open( TQFile::ReadWrite | TQFile::Text ) ) {
inputSrcFile.write( sourceCode.toUtf8() );
inputSrcFile.close();
- qDebug() << __LINE__ << " " << __FUNCTION__ << ": Wrote to be indented source code to file " << inputSrcFile.fileName();
+ tqDebug() << __LINE__ << " " << __FUNCTION__ << ": Wrote to be indented source code to file " << inputSrcFile.fileName();
}
else {
qCritical() << __LINE__ << " " << __FUNCTION__ << ": Couldn't write to be indented source code to file " << inputSrcFile.fileName();
@@ -465,15 +465,15 @@ QString IndentHandler::callExecutableIndenter(QString sourceCode, QString inputF
#ifdef Q_OS_WIN32
// Paths may contain Unicode or other foreign characters. Windows commands line tools will
- // receive als falsely encoded path string by QProcess or they connot correctly handle
+ // receive als falsely encoded path string by TQProcess or they connot correctly handle
// the Unicode path on their own.
// Because of this the path gets converted to Windows short paths using the 8.3 notation.
- qDebug() << __LINE__ << " " << __FUNCTION__ << ": Temp dir before trying to convert it to short Windows path is" << _tempDirctoryStr;
+ tqDebug() << __LINE__ << " " << __FUNCTION__ << ": Temp dir before trying to convert it to short Windows path is" << _tempDirctoryStr;
// At first convert the temp path to Windows like separators.
- QString tempDirctoryStrHelper = QDir::toNativeSeparators(_tempDirctoryStr).replace("\\", "\\\\");
- // Then convert the QString to a WCHAR array and NULL terminate it.
+ TQString tempDirctoryStrHelper = TQDir::toNativeSeparators(_tempDirctoryStr).replace("\\", "\\\\");
+ // Then convert the TQString to a WCHAR array and NULL terminate it.
WCHAR *tempDirctoryWindowsStr = new WCHAR[ tempDirctoryStrHelper.length()+1 ];
tempDirctoryStrHelper.toWCharArray( tempDirctoryWindowsStr );
tempDirctoryWindowsStr[ tempDirctoryStrHelper.length() ] = (WCHAR)NULL;
@@ -484,30 +484,30 @@ QString IndentHandler::callExecutableIndenter(QString sourceCode, QString inputF
length = GetShortPathName((LPCTSTR)tempDirctoryWindowsStr, NULL, 0);
// If the short path could be retrieved, create a correct sized buffer, store the
- // short path in it and convert all back to QString.
+ // short path in it and convert all back to TQString.
if ( length != 0 ) {
#ifdef UNICODE
buffer = new WCHAR[length];
length = GetShortPathName((LPCTSTR)tempDirctoryWindowsStr, buffer, length);
- tempDirctoryStrHelper = QString::fromWCharArray( buffer );
+ tempDirctoryStrHelper = TQString::fromWCharArray( buffer );
#else
buffer = new TCHAR[length];
length = GetShortPathName((LPCTSTR)tempDirctoryWindowsStr, buffer, length);
tempDirctoryStrHelper = buffer;
#endif
- _tempDirctoryStr = QDir::fromNativeSeparators(tempDirctoryStrHelper).replace("//", "/");
+ _tempDirctoryStr = TQDir::fromNativeSeparators(tempDirctoryStrHelper).replace("//", "/");
delete [] buffer;
// Check whether the short path still contains some kind of non ascii characters.
if ( _tempDirctoryStr.length() != _tempDirctoryStr.toAscii().length() ) {
- qWarning() << __LINE__ << " " << __FUNCTION__ << ": Shortened path still contains non ascii characters. Could cause some indenters not to work properly!";
+ tqWarning() << __LINE__ << " " << __FUNCTION__ << ": Shortened path still contains non ascii characters. Could cause some indenters not to work properly!";
}
}
else {
- qWarning() << __LINE__ << " " << __FUNCTION__ << ": Couldn't retrieve a short version of the temporary path!";
+ tqWarning() << __LINE__ << " " << __FUNCTION__ << ": Couldn't retrieve a short version of the temporary path!";
}
- qDebug() << __LINE__ << " " << __FUNCTION__ << ": Temp dir after trying to convert it to short Windows path is " << _tempDirctoryStr;
+ tqDebug() << __LINE__ << " " << __FUNCTION__ << ": Temp dir after trying to convert it to short Windows path is " << _tempDirctoryStr;
delete [] tempDirctoryWindowsStr;
#endif
@@ -546,17 +546,17 @@ QString IndentHandler::callExecutableIndenter(QString sourceCode, QString inputF
indenterCompleteCallString = _indenterExecutableCallString + indenterCompleteCallString;
// errors and standard outputs from the process call are merged together
- //indentProcess.setReadChannelMode(QProcess::MergedChannels);
+ //indentProcess.setReadChannelMode(TQProcess::MergedChannels);
// Set the directory where the indenter will be executed for the process' environment as PWD.
- QStringList env = indentProcess.environment();
- env << "PWD=" + QFileInfo(_tempDirctoryStr).absoluteFilePath();
+ TQStringList env = indentProcess.environment();
+ env << "PWD=" + TQFileInfo(_tempDirctoryStr).absoluteFilePath();
indentProcess.setEnvironment( env );
// Set the directory for the indenter execution
- indentProcess.setWorkingDirectory( QFileInfo(_tempDirctoryStr).absoluteFilePath() );
+ indentProcess.setWorkingDirectory( TQFileInfo(_tempDirctoryStr).absoluteFilePath() );
- qDebug() << __LINE__ << " " << __FUNCTION__ << ": Will call the indenter in the directory " << indentProcess.workingDirectory() << " using this commandline call: " << indenterCompleteCallString;
+ tqDebug() << __LINE__ << " " << __FUNCTION__ << ": Will call the indenter in the directory " << indentProcess.workingDirectory() << " using this commandline call: " << indenterCompleteCallString;
indentProcess.start(indenterCompleteCallString);
@@ -568,22 +568,22 @@ QString IndentHandler::callExecutableIndenter(QString sourceCode, QString inputF
processReturnString += tr("<b>Returned error message:</b> ") + indentProcess.errorString() + "<br>";
switch ( indentProcess.error() ) {
- case QProcess::FailedToStart :
+ case TQProcess::FailedToStart :
processReturnString += tr("<b>Reason could be:</b> ") + "The process failed to start. Either the invoked program is missing, or you may have insufficient permissions to invoke the program.<br>";
break;
- case QProcess::Crashed :
+ case TQProcess::Crashed :
processReturnString += "The process crashed some time after starting successfully.<br>";
break;
- case QProcess::Timedout :
+ case TQProcess::Timedout :
processReturnString += "The called indenter did not response for over 10 seconds, so aborted its execution.<br>";
break;
- case QProcess::WriteError :
+ case TQProcess::WriteError :
processReturnString += "An error occurred when attempting to write to the process. For example, the process may not be running, or it may have closed its input channel.<br>";
break;
- case QProcess::ReadError :
+ case TQProcess::ReadError :
processReturnString += "An error occurred when attempting to read from the process. For example, the process may not be running.<br>";
break;
- case QProcess::UnknownError :
+ case TQProcess::UnknownError :
processReturnString += "An unknown error occurred. This is the default return value of error().<br>";
break;
default :
@@ -594,15 +594,15 @@ QString IndentHandler::callExecutableIndenter(QString sourceCode, QString inputF
"(STDOUT):" + encodeToHTML( indentProcess.readAllStandardOutput() ) + "<br>" +
"(STDERR):" + encodeToHTML( indentProcess.readAllStandardError() ) + "<br>" +
"</pre></html></body>";
- qWarning() << __LINE__ << " " << __FUNCTION__ << processReturnString;
- QApplication::restoreOverrideCursor();
+ tqWarning() << __LINE__ << " " << __FUNCTION__ << processReturnString;
+ TQApplication::restoreOverrideCursor();
_errorMessageDialog->showMessage(tr("Error calling Indenter"), processReturnString);
}
// If the indenter returned an error code != 0 show its output.
if ( indentProcess.exitCode() != 0 ) {
- QString exitCode;
+ TQString exitCode;
exitCode.setNum(indentProcess.exitCode());
processReturnString = tr("<b>Indenter returned with exit code:</b> ") + exitCode + "<br>" +
tr("<b>Indent console output was:</b> ") + "<br>" +
@@ -610,8 +610,8 @@ QString IndentHandler::callExecutableIndenter(QString sourceCode, QString inputF
"(STDERR):" + encodeToHTML( indentProcess.readAllStandardError() ) + "<br>" +
tr("<br><b>Callstring was:</b> ") + encodeToHTML(indenterCompleteCallString) +
"</html></body>";
- qWarning() << __LINE__ << " " << __FUNCTION__ << processReturnString;
- QApplication::restoreOverrideCursor();
+ tqWarning() << __LINE__ << " " << __FUNCTION__ << processReturnString;
+ TQApplication::restoreOverrideCursor();
_errorMessageDialog->showMessage( tr("Indenter returned error"), processReturnString );
}
@@ -620,17 +620,17 @@ QString IndentHandler::callExecutableIndenter(QString sourceCode, QString inputF
// If the indenter results are written to stdout, read them from there...
if ( indentProcess.exitCode() == 0 && _outputFileParameter == "stdout" ) {
formattedSourceCode = indentProcess.readAllStandardOutput();
- qDebug() << __LINE__ << " " << __FUNCTION__ << ": Read indenter output from StdOut.";
+ tqDebug() << __LINE__ << " " << __FUNCTION__ << ": Read indenter output from StdOut.";
}
// ... else read the output file generated by the indenter call.
else {
- QFile outSrcFile(_tempDirctoryStr + "/" + _outputFileName + inputFileExtension);
- if ( outSrcFile.open(QFile::ReadOnly | QFile::Text) ) {
- QTextStream outSrcStrm(&outSrcFile);
- outSrcStrm.setCodec( QTextCodec::codecForName("UTF-8") );
+ TQFile outSrcFile(_tempDirctoryStr + "/" + _outputFileName + inputFileExtension);
+ if ( outSrcFile.open(TQFile::ReadOnly | TQFile::Text) ) {
+ TQTextStream outSrcStrm(&outSrcFile);
+ outSrcStrm.setCodec( TQTextCodec::codecForName("UTF-8") );
formattedSourceCode = outSrcStrm.readAll();
outSrcFile.close();
- qDebug() << __LINE__ << " " << __FUNCTION__ << ": Read indenter output from file " << outSrcFile.fileName();
+ tqDebug() << __LINE__ << " " << __FUNCTION__ << ": Read indenter output from file " << outSrcFile.fileName();
}
else {
qCritical() << __LINE__ << " " << __FUNCTION__ << ": Couldn't read indenter output from file " << outSrcFile.fileName();
@@ -642,8 +642,8 @@ QString IndentHandler::callExecutableIndenter(QString sourceCode, QString inputF
}
// Delete the temporary input and output files.
- QFile::remove(_tempDirctoryStr + "/" + _outputFileName + inputFileExtension);
- QFile::remove(_tempDirctoryStr + "/" + _inputFileName + inputFileExtension);
+ TQFile::remove(_tempDirctoryStr + "/" + _outputFileName + inputFileExtension);
+ TQFile::remove(_tempDirctoryStr + "/" + _inputFileName + inputFileExtension);
return formattedSourceCode;
}
@@ -652,8 +652,8 @@ QString IndentHandler::callExecutableIndenter(QString sourceCode, QString inputF
/*!
\brief Generates and returns a string with all parameters needed to call the indenter.
*/
-QString IndentHandler::getParameterString() {
- QString parameterString = "";
+TQString IndentHandler::getParameterString() {
+ TQString parameterString = "";
// generate parameter string for all boolean values
foreach (ParamBoolean pBoolean, _paramBooleans) {
@@ -672,7 +672,7 @@ QString IndentHandler::getParameterString() {
// generate parameter string for all numeric values
foreach (ParamNumeric pNumeric, _paramNumerics) {
if ( pNumeric.valueEnabledChkBox->isChecked() ) {
- parameterString += pNumeric.paramCallName + QString::number( pNumeric.spinBox->value() ) + _cfgFileParameterEnding;
+ parameterString += pNumeric.paramCallName + TQString::number( pNumeric.spinBox->value() ) + _cfgFileParameterEnding;
}
}
@@ -680,7 +680,7 @@ QString IndentHandler::getParameterString() {
foreach (ParamString pString, _paramStrings) {
if ( !pString.lineEdit->text().isEmpty() && pString.valueEnabledChkBox->isChecked() ) {
// Create parameter definition for each value devided by a | sign.
- foreach (QString paramValue, pString.lineEdit->text().split("|")) {
+ foreach (TQString paramValue, pString.lineEdit->text().split("|")) {
parameterString += pString.paramCallName + paramValue + _cfgFileParameterEnding;
}
}
@@ -700,11 +700,11 @@ QString IndentHandler::getParameterString() {
/*!
\brief Write settings for the indenter to a config file.
*/
-void IndentHandler::saveConfigFile(QString filePathName, QString paramString) {
- QFile::remove( filePathName );
- QFile cfgFile( filePathName );
+void IndentHandler::saveConfigFile(TQString filePathName, TQString paramString) {
+ TQFile::remove( filePathName );
+ TQFile cfgFile( filePathName );
- cfgFile.open( QFile::ReadWrite | QFile::Text );
+ cfgFile.open( TQFile::ReadWrite | TQFile::Text );
cfgFile.write( paramString.toAscii() );
cfgFile.close();
}
@@ -713,13 +713,13 @@ void IndentHandler::saveConfigFile(QString filePathName, QString paramString) {
/*!
\brief Load the config file for the indenter and apply the settings made there.
*/
-bool IndentHandler::loadConfigFile(QString filePathName) {
- QFile cfgFile(filePathName);
+bool IndentHandler::loadConfigFile(TQString filePathName) {
+ TQFile cfgFile(filePathName);
int index;
int crPos;
int paramValue = 0;
- QString paramValueStr = "";
- QString cfgFileData = "";
+ TQString paramValueStr = "";
+ TQString cfgFileData = "";
// If the to be loaded config file does not exist leave all values as they are and return false.
if ( !cfgFile.exists() ) {
@@ -728,7 +728,7 @@ bool IndentHandler::loadConfigFile(QString filePathName) {
// else if the to be read config file exists, retrieve its whole content.
else {
// Open the config file and read all data
- cfgFile.open( QFile::ReadOnly | QFile::Text );
+ cfgFile.open( TQFile::ReadOnly | TQFile::Text );
cfgFileData = cfgFile.readAll();
cfgFile.close();
}
@@ -742,14 +742,14 @@ bool IndentHandler::loadConfigFile(QString filePathName) {
// the true parameter string is longer than the false string
if ( pBoolean.trueString.length() > pBoolean.falseString.length() ) {
// search for the true string
- index = cfgFileData.indexOf( pBoolean.trueString, 0, Qt::CaseInsensitive );
+ index = cfgFileData.indexOf( pBoolean.trueString, 0, TQt::CaseInsensitive );
// if true string found set the parameter value to true
if ( index != -1 ) {
paramValue = true;
}
// if true string not found, search for false string
else {
- index = cfgFileData.indexOf( pBoolean.falseString, 0, Qt::CaseInsensitive );
+ index = cfgFileData.indexOf( pBoolean.falseString, 0, TQt::CaseInsensitive );
// if false string found set the parameter value to false
if ( index != -1 ) {
paramValue = false;
@@ -763,14 +763,14 @@ bool IndentHandler::loadConfigFile(QString filePathName) {
// the false parameter string is longer than the true string
else {
// search for the false string
- index = cfgFileData.indexOf( pBoolean.falseString, 0, Qt::CaseInsensitive );
+ index = cfgFileData.indexOf( pBoolean.falseString, 0, TQt::CaseInsensitive );
// if false string found set the parameter value to false
if ( index != -1 ) {
paramValue = false;
}
// if false string not found, search for true string
else {
- index = cfgFileData.indexOf( pBoolean.trueString, 0, Qt::CaseInsensitive );
+ index = cfgFileData.indexOf( pBoolean.trueString, 0, TQt::CaseInsensitive );
// if true string found set the parameter value to true
if ( index != -1 ) {
paramValue = true;
@@ -786,7 +786,7 @@ bool IndentHandler::loadConfigFile(QString filePathName) {
// Search for name of each numeric parameter and set the value found behind it.
foreach (ParamNumeric pNumeric, _paramNumerics) {
- index = cfgFileData.indexOf( pNumeric.paramCallName, 0, Qt::CaseInsensitive );
+ index = cfgFileData.indexOf( pNumeric.paramCallName, 0, TQt::CaseInsensitive );
// parameter was found in config file
if ( index != -1 ) {
// set index after the parameter name, so in front of the number
@@ -796,14 +796,14 @@ bool IndentHandler::loadConfigFile(QString filePathName) {
crPos = cfgFileData.indexOf( _cfgFileParameterEnding, index+1 );
// get the number and convert it to int
- QString test = cfgFileData.mid( index, crPos - index );
+ TQString test = cfgFileData.mid( index, crPos - index );
paramValue = cfgFileData.mid( index, crPos - index ).toInt(NULL);
// disable the signal-slot connection. Otherwise signal is emmitted each time when value is set
- QObject::disconnect(pNumeric.spinBox, SIGNAL(valueChanged(int)), this, SLOT(handleChangedIndenterSettings()));
+ TQObject::disconnect(pNumeric.spinBox, SIGNAL(valueChanged(int)), this, SLOT(handleChangedIndenterSettings()));
pNumeric.spinBox->setValue( paramValue );
pNumeric.valueEnabledChkBox->setChecked( true );
- QObject::connect(pNumeric.spinBox, SIGNAL(valueChanged(int)), this, SLOT(handleChangedIndenterSettings()));
+ TQObject::connect(pNumeric.spinBox, SIGNAL(valueChanged(int)), this, SLOT(handleChangedIndenterSettings()));
}
// parameter was not found in config file
else {
@@ -818,7 +818,7 @@ bool IndentHandler::loadConfigFile(QString filePathName) {
paramValueStr = "";
// The number of the found values for this parameter name.
int numberOfValues = 0;
- index = cfgFileData.indexOf( pString.paramCallName, 0, Qt::CaseInsensitive );
+ index = cfgFileData.indexOf( pString.paramCallName, 0, TQt::CaseInsensitive );
// If parameter was found in config file
if ( index != -1 ) {
while ( index != -1 ) {
@@ -832,15 +832,15 @@ bool IndentHandler::loadConfigFile(QString filePathName) {
// Get the string and remember it.
if ( numberOfValues < 2 ) {
- paramValueStr = QString( cfgFileData.mid( index, crPos - index ) );
+ paramValueStr = TQString( cfgFileData.mid( index, crPos - index ) );
}
// If the same parameter has been set multiple times, concatenate the strings dvivided by a |.
else {
- paramValueStr = paramValueStr + "|" + QString( cfgFileData.mid( index, crPos - index ) );
+ paramValueStr = paramValueStr + "|" + TQString( cfgFileData.mid( index, crPos - index ) );
}
// Get next value for this setting, if one exists.
- index = cfgFileData.indexOf( pString.paramCallName, crPos+1, Qt::CaseInsensitive );
+ index = cfgFileData.indexOf( pString.paramCallName, crPos+1, TQt::CaseInsensitive );
}
// Set the text for the line edit.
pString.lineEdit->setText( paramValueStr );
@@ -862,7 +862,7 @@ bool IndentHandler::loadConfigFile(QString filePathName) {
// search for all parameter names of the multiple choice list
// if one is found, set it and leave the while loop
while ( i < pMultiple.choicesStrings.count() && index == -1 ) {
- index = cfgFileData.indexOf( pMultiple.choicesStrings.at(i), 0, Qt::CaseInsensitive );
+ index = cfgFileData.indexOf( pMultiple.choicesStrings.at(i), 0, TQt::CaseInsensitive );
if ( index != -1 ) {
pMultiple.comboBox->setCurrentIndex( i );
pMultiple.valueEnabledChkBox->setChecked( true );
@@ -902,7 +902,7 @@ void IndentHandler::resetToDefaultValues() {
// Search for name of each string parameter and set it.
foreach (ParamString pString, _paramStrings) {
- QString defaultValue = _indenterSettings->value(pString.paramName + "/ValueDefault").toString();
+ TQString defaultValue = _indenterSettings->value(pString.paramName + "/ValueDefault").toString();
pString.lineEdit->setText( defaultValue );
pString.valueEnabledChkBox->setChecked( _indenterSettings->value(pString.paramName + "/Enabled").toBool() );
}
@@ -919,15 +919,15 @@ void IndentHandler::resetToDefaultValues() {
/*!
\brief Opens and parses the indenter ini file that is declared by \a iniFilePath.
*/
-void IndentHandler::readIndentIniFile(QString iniFilePath) {
+void IndentHandler::readIndentIniFile(TQString iniFilePath) {
Q_ASSERT_X( !iniFilePath.isEmpty(), "readIndentIniFile", "iniFilePath is empty" );
// open the ini-file that contains all available indenter settings with their additional infos
_indenterSettings = new UiGuiIniFileParser(iniFilePath);
- QStringList categories;
- //QString indenterGroupString = "";
- QString paramToolTip = "";
+ TQStringList categories;
+ //TQString indenterGroupString = "";
+ TQString paramToolTip = "";
//
@@ -960,7 +960,7 @@ void IndentHandler::readIndentIniFile(QString iniFilePath) {
_fileTypes.replace('|', " ");
// read the categories names which are separated by "|"
- QString categoriesStr = _indenterSettings->value("header/categories").toString();
+ TQString categoriesStr = _indenterSettings->value("header/categories").toString();
categories = categoriesStr.split("|");
// Assure that the category list is never empty. At least contain a "general" section.
if ( categories.isEmpty() ) {
@@ -970,11 +970,11 @@ void IndentHandler::readIndentIniFile(QString iniFilePath) {
IndenterParameterCategoryPage categoryPage;
// create a page for each category and store its references in a toolboxpage-array
- foreach (QString category, categories) {
- categoryPage.widget = new QWidget();
+ foreach (TQString category, categories) {
+ categoryPage.widget = new TQWidget();
categoryPage.widget->setObjectName(category);
- categoryPage.widget->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding);
- categoryPage.vboxLayout = new QVBoxLayout(categoryPage.widget);
+ categoryPage.widget->setSizePolicy(TQSizePolicy::MinimumExpanding, TQSizePolicy::MinimumExpanding);
+ categoryPage.vboxLayout = new TQVBoxLayout(categoryPage.widget);
categoryPage.vboxLayout->setSpacing(6);
categoryPage.vboxLayout->setMargin(9);
categoryPage.vboxLayout->setObjectName(category);
@@ -991,7 +991,7 @@ void IndentHandler::readIndentIniFile(QString iniFilePath) {
_indenterParameters = _indenterSettings->childGroups();
// read each parameter to create the corresponding input field
- foreach (QString indenterParameter, _indenterParameters) {
+ foreach (TQString indenterParameter, _indenterParameters) {
// if it is not the indent header definition read the parameter and add it to
// the corresponding category toolbox page
if ( indenterParameter != "header") {
@@ -1002,24 +1002,24 @@ void IndentHandler::readIndentIniFile(QString iniFilePath) {
category = _indenterParameterCategoryPages.size()-1;
}
// read which type of input field the parameter needs
- QString editType = _indenterSettings->value(indenterParameter + "/EditorType").toString();
+ TQString editType = _indenterSettings->value(indenterParameter + "/EditorType").toString();
// edit type is numeric so create a spinbox with label
if ( editType == "numeric" ) {
// read the parameter name as it is used at the command line or in its config file
- QString parameterCallName = _indenterSettings->value(indenterParameter + "/CallName").toString();
+ TQString parameterCallName = _indenterSettings->value(indenterParameter + "/CallName").toString();
// create checkbox which enables or disables the parameter
- QCheckBox *chkBox = new QCheckBox( _indenterParameterCategoryPages.at(category).widget );
+ TQCheckBox *chkBox = new TQCheckBox( _indenterParameterCategoryPages.at(category).widget );
chkBox->setChecked( _indenterSettings->value(indenterParameter + "/Enabled").toBool() );
chkBox->setToolTip( "Enables/disables the parameter. If disabled the indenters default value will be used." );
- chkBox->setSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed );
+ chkBox->setSizePolicy( TQSizePolicy::Fixed, TQSizePolicy::Fixed );
int left, top, right, bottom;
chkBox->getContentsMargins( &left, &top, &right, &bottom );
chkBox->setContentsMargins( left, top, 0, bottom );
// create the spinbox
- QSpinBox *spinBox = new QSpinBox( _indenterParameterCategoryPages.at(category).widget );
+ TQSpinBox *spinBox = new TQSpinBox( _indenterParameterCategoryPages.at(category).widget );
paramToolTip = _indenterSettings->value(indenterParameter + "/Description").toString();
spinBox->setToolTip( paramToolTip );
spinBox->setMaximumWidth(50);
@@ -1041,7 +1041,7 @@ void IndentHandler::readIndentIniFile(QString iniFilePath) {
}
// create the label
- QLabel *label = new QLabel( _indenterParameterCategoryPages.at(category).widget );
+ TQLabel *label = new TQLabel( _indenterParameterCategoryPages.at(category).widget );
label->setText(indenterParameter);
label->setBuddy(spinBox);
label->setToolTip( paramToolTip );
@@ -1050,7 +1050,7 @@ void IndentHandler::readIndentIniFile(QString iniFilePath) {
}
// put all into a layout and add it to the toolbox page
- QHBoxLayout *hboxLayout = new QHBoxLayout();
+ TQHBoxLayout *hboxLayout = new TQHBoxLayout();
hboxLayout->addWidget(chkBox);
hboxLayout->addWidget(spinBox);
hboxLayout->addWidget(label);
@@ -1066,8 +1066,8 @@ void IndentHandler::readIndentIniFile(QString iniFilePath) {
paramNumeric.spinBox->setValue( _indenterSettings->value(paramNumeric.paramName + "/ValueDefault").toInt() );
_paramNumerics.append(paramNumeric);
- QObject::connect(spinBox, SIGNAL(valueChanged(int)), this, SLOT(handleChangedIndenterSettings()));
- QObject::connect(chkBox, SIGNAL(clicked()), this, SLOT(handleChangedIndenterSettings()));
+ TQObject::connect(spinBox, SIGNAL(valueChanged(int)), this, SLOT(handleChangedIndenterSettings()));
+ TQObject::connect(chkBox, SIGNAL(clicked()), this, SLOT(handleChangedIndenterSettings()));
#ifdef UNIVERSALINDENTGUI_NPP_EXPORTS
connect( spinBox, SIGNAL(valueChanged(int)), this, SLOT(updateDrawing()) );
#endif // UNIVERSALINDENTGUI_NPP_EXPORTS
@@ -1075,7 +1075,7 @@ void IndentHandler::readIndentIniFile(QString iniFilePath) {
// edit type is boolean so create a checkbox
else if ( editType == "boolean" ) {
// create the checkbox, make its settings and add it to the toolbox page
- QCheckBox *chkBox = new QCheckBox( _indenterParameterCategoryPages.at(category).widget );
+ TQCheckBox *chkBox = new TQCheckBox( _indenterParameterCategoryPages.at(category).widget );
chkBox->setText(indenterParameter);
paramToolTip = _indenterSettings->value(indenterParameter + "/Description").toString();
chkBox->setToolTip( paramToolTip );
@@ -1088,30 +1088,30 @@ void IndentHandler::readIndentIniFile(QString iniFilePath) {
ParamBoolean paramBoolean;
paramBoolean.paramName = indenterParameter;
paramBoolean.checkBox = chkBox;
- QStringList trueFalseStrings = _indenterSettings->value(indenterParameter + "/TrueFalse").toString().split("|");
+ TQStringList trueFalseStrings = _indenterSettings->value(indenterParameter + "/TrueFalse").toString().split("|");
paramBoolean.trueString = trueFalseStrings.at(0);
paramBoolean.falseString = trueFalseStrings.at(1);
paramBoolean.checkBox->setChecked( _indenterSettings->value(paramBoolean.paramName + "/ValueDefault").toBool() );
_paramBooleans.append(paramBoolean);
- QObject::connect(chkBox, SIGNAL(clicked()), this, SLOT(handleChangedIndenterSettings()));
+ TQObject::connect(chkBox, SIGNAL(clicked()), this, SLOT(handleChangedIndenterSettings()));
}
// edit type is numeric so create a line edit with label
else if ( editType == "string" ) {
// read the parameter name as it is used at the command line or in its config file
- QString parameterCallName = _indenterSettings->value(indenterParameter + "/CallName").toString();
+ TQString parameterCallName = _indenterSettings->value(indenterParameter + "/CallName").toString();
// create check box which enables or disables the parameter
- QCheckBox *chkBox = new QCheckBox( _indenterParameterCategoryPages.at(category).widget );
+ TQCheckBox *chkBox = new TQCheckBox( _indenterParameterCategoryPages.at(category).widget );
chkBox->setChecked( _indenterSettings->value(indenterParameter + "/Enabled").toBool() );
chkBox->setToolTip( "Enables/disables the parameter. If disabled the indenters default value will be used." );
- chkBox->setSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed );
+ chkBox->setSizePolicy( TQSizePolicy::Fixed, TQSizePolicy::Fixed );
int left, top, right, bottom;
chkBox->getContentsMargins( &left, &top, &right, &bottom );
chkBox->setContentsMargins( left, top, 0, bottom );
// create the line edit
- QLineEdit *lineEdit = new QLineEdit( _indenterParameterCategoryPages.at(category).widget );
+ TQLineEdit *lineEdit = new TQLineEdit( _indenterParameterCategoryPages.at(category).widget );
paramToolTip = _indenterSettings->value(indenterParameter + "/Description").toString();
lineEdit->setToolTip( paramToolTip );
lineEdit->setMaximumWidth(50);
@@ -1121,17 +1121,17 @@ void IndentHandler::readIndentIniFile(QString iniFilePath) {
}
// create the label
- QLabel *label = new QLabel( _indenterParameterCategoryPages.at(category).widget );
+ TQLabel *label = new TQLabel( _indenterParameterCategoryPages.at(category).widget );
label->setText(indenterParameter);
label->setBuddy(lineEdit);
- label->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Preferred);
+ label->setSizePolicy(TQSizePolicy::MinimumExpanding, TQSizePolicy::Preferred);
label->setToolTip( paramToolTip );
if ( _mainWindow != NULL ) {
label->installEventFilter( _mainWindow );
}
// put all into a layout and add it to the toolbox page
- QHBoxLayout *hboxLayout = new QHBoxLayout();
+ TQHBoxLayout *hboxLayout = new TQHBoxLayout();
hboxLayout->addWidget(chkBox);
hboxLayout->addWidget(lineEdit);
hboxLayout->addWidget(label);
@@ -1147,30 +1147,30 @@ void IndentHandler::readIndentIniFile(QString iniFilePath) {
paramString.lineEdit->setText( _indenterSettings->value(paramString.paramName + "/ValueDefault").toString() );
_paramStrings.append(paramString);
- QObject::connect(lineEdit, SIGNAL(editingFinished()), this, SLOT(handleChangedIndenterSettings()));
- QObject::connect(chkBox, SIGNAL(clicked()), this, SLOT(handleChangedIndenterSettings()));
+ TQObject::connect(lineEdit, SIGNAL(editingFinished()), this, SLOT(handleChangedIndenterSettings()));
+ TQObject::connect(chkBox, SIGNAL(clicked()), this, SLOT(handleChangedIndenterSettings()));
#ifdef UNIVERSALINDENTGUI_NPP_EXPORTS
- connect( lineEdit, SIGNAL(textChanged(const QString)), this, SLOT(updateDrawing()) );
+ connect( lineEdit, SIGNAL(textChanged(const TQString)), this, SLOT(updateDrawing()) );
#endif // UNIVERSALINDENTGUI_NPP_EXPORTS
}
// edit type is multiple so create a combobox with label
else if ( editType == "multiple" ) {
// read the parameter name as it is used at the command line or in its config file
- QString parameterCallName = _indenterSettings->value(indenterParameter + "/CallName").toString();
+ TQString parameterCallName = _indenterSettings->value(indenterParameter + "/CallName").toString();
// create checkbox which enables or disables the parameter
- QCheckBox *chkBox = new QCheckBox( _indenterParameterCategoryPages.at(category).widget );
+ TQCheckBox *chkBox = new TQCheckBox( _indenterParameterCategoryPages.at(category).widget );
chkBox->setChecked( _indenterSettings->value(indenterParameter + "/Enabled").toBool() );
chkBox->setToolTip( "Enables/disables the parameter. If disabled the indenters default value will be used." );
- chkBox->setSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed );
+ chkBox->setSizePolicy( TQSizePolicy::Fixed, TQSizePolicy::Fixed );
int left, top, right, bottom;
chkBox->getContentsMargins( &left, &top, &right, &bottom );
chkBox->setContentsMargins( left, top, 0, bottom );
// create the combo box
- QComboBox *comboBox = new QComboBox( _indenterParameterCategoryPages.at(category).widget );
- QStringList choicesStrings = _indenterSettings->value(indenterParameter + "/Choices").toString().split("|");
- QStringList choicesStringsReadable = _indenterSettings->value(indenterParameter + "/ChoicesReadable").toString().split("|", QString::SkipEmptyParts);
+ TQComboBox *comboBox = new TQComboBox( _indenterParameterCategoryPages.at(category).widget );
+ TQStringList choicesStrings = _indenterSettings->value(indenterParameter + "/Choices").toString().split("|");
+ TQStringList choicesStringsReadable = _indenterSettings->value(indenterParameter + "/ChoicesReadable").toString().split("|", TQString::SkipEmptyParts);
if ( choicesStringsReadable.isEmpty() ) {
comboBox->addItems( choicesStrings );
}
@@ -1184,7 +1184,7 @@ void IndentHandler::readIndentIniFile(QString iniFilePath) {
}
// put all into a layout and add it to the toolbox page
- QHBoxLayout *hboxLayout = new QHBoxLayout();
+ TQHBoxLayout *hboxLayout = new TQHBoxLayout();
hboxLayout->addWidget(chkBox);
hboxLayout->addWidget(comboBox);
_indenterParameterCategoryPages.at(category).vboxLayout->addLayout(hboxLayout);
@@ -1200,8 +1200,8 @@ void IndentHandler::readIndentIniFile(QString iniFilePath) {
paramMultiple.comboBox->setCurrentIndex( _indenterSettings->value(paramMultiple.paramName + "/ValueDefault").toInt() );
_paramMultiples.append(paramMultiple);
- QObject::connect(comboBox, SIGNAL(activated(int)), this, SLOT(handleChangedIndenterSettings()));
- QObject::connect(chkBox, SIGNAL(clicked()), this, SLOT(handleChangedIndenterSettings()));
+ TQObject::connect(comboBox, SIGNAL(activated(int)), this, SLOT(handleChangedIndenterSettings()));
+ TQObject::connect(chkBox, SIGNAL(clicked()), this, SLOT(handleChangedIndenterSettings()));
#ifdef UNIVERSALINDENTGUI_NPP_EXPORTS
connect( comboBox, SIGNAL(activated(int)), this, SLOT(updateDrawing()) );
#endif // UNIVERSALINDENTGUI_NPP_EXPORTS
@@ -1220,18 +1220,18 @@ void IndentHandler::readIndentIniFile(QString iniFilePath) {
\brief Searches and returns all indenters a configuration file is found for.
Opens all uigui ini files found in the list \a _indenterIniFileList, opens each ini file
- and reads the there defined real name of the indenter. These names are being returned as QStringList.
+ and reads the there defined real name of the indenter. These names are being returned as TQStringList.
*/
-QStringList IndentHandler::getAvailableIndenters() {
- QStringList indenterNamesList;
+TQStringList IndentHandler::getAvailableIndenters() {
+ TQStringList indenterNamesList;
// Loop for every existing uigui ini file
- foreach (QString indenterIniFile, _indenterIniFileList) {
+ foreach (TQString indenterIniFile, _indenterIniFileList) {
// Open the ini file and search for the indenter name
- QFile file(_indenterDirctoryStr + "/" + indenterIniFile);
- if ( file.open(QIODevice::ReadOnly | QIODevice::Text) ) {
+ TQFile file(_indenterDirctoryStr + "/" + indenterIniFile);
+ if ( file.open(TQIODevice::ReadOnly | TQIODevice::Text) ) {
int index = -1;
- QByteArray line;
+ TQByteArray line;
// Search for the string "indenterName=" and get the following string until line end.
while ( index == -1 && !file.atEnd() ) {
line = file.readLine();
@@ -1252,14 +1252,14 @@ QStringList IndentHandler::getAvailableIndenters() {
\brief Deletes all elements in the toolbox and initializes the indenter selected by \a indenterID.
*/
void IndentHandler::setIndenter(int indenterID) {
- QApplication::setOverrideCursor(Qt::WaitCursor);
+ TQApplication::setOverrideCursor(TQt::WaitCursor);
#ifdef UNIVERSALINDENTGUI_NPP_EXPORTS
disconnect( _indenterParameterCategoriesToolBox, SIGNAL(currentChanged(int)), this, SLOT(updateDrawing()) );
#endif // UNIVERSALINDENTGUI_NPP_EXPORTS
// Generate the parameter string that will be saved to the indenters config file.
- QString parameterString = getParameterString();
+ TQString parameterString = getParameterString();
if ( !_indenterFileName.isEmpty() ) {
saveConfigFile( _settingsDirctoryStr + "/" + _indenterFileName + ".cfg", parameterString );
}
@@ -1291,7 +1291,7 @@ void IndentHandler::setIndenter(int indenterID) {
delete _indenterSettings;
#ifdef UNIVERSALINDENTGUI_NPP_EXPORTS
- QWidget dummyWidget;
+ TQWidget dummyWidget;
_indenterParameterCategoriesToolBox->addItem(&dummyWidget, "dummyText");
#endif
@@ -1305,7 +1305,7 @@ void IndentHandler::setIndenter(int indenterID) {
handleChangedIndenterSettings();
- QApplication::restoreOverrideCursor();
+ TQApplication::restoreOverrideCursor();
#ifdef UNIVERSALINDENTGUI_NPP_EXPORTS
connect( _indenterParameterCategoriesToolBox, SIGNAL(currentChanged(int)), this, SLOT(updateDrawing()) );
@@ -1317,7 +1317,7 @@ void IndentHandler::setIndenter(int indenterID) {
/*!
\brief Returns a string containing by the indenter supported file types/extensions divided by a space.
*/
-QString IndentHandler::getPossibleIndenterFileExtensions() {
+TQString IndentHandler::getPossibleIndenterFileExtensions() {
return _fileTypes;
}
@@ -1325,8 +1325,8 @@ QString IndentHandler::getPossibleIndenterFileExtensions() {
/*!
\brief Returns the path and filename of the current indenter config file.
*/
-QString IndentHandler::getIndenterCfgFile() {
- QFileInfo fileInfo( _indenterDirctoryStr + "/" + _globalConfigFilename );
+TQString IndentHandler::getIndenterCfgFile() {
+ TQFileInfo fileInfo( _indenterDirctoryStr + "/" + _globalConfigFilename );
return fileInfo.absoluteFilePath();
}
@@ -1335,7 +1335,7 @@ QString IndentHandler::getIndenterCfgFile() {
\brief Tries to create a call path string for the indenter executable. If successful returns true.
*/
bool IndentHandler::createIndenterCallString() {
- QProcess indentProcess;
+ TQProcess indentProcess;
if ( _indenterFileName.isEmpty() ) {
return false;
@@ -1345,23 +1345,23 @@ bool IndentHandler::createIndenterCallString() {
// ------------------------------------------------------------------------
// Set the directory for the indenter execution
- indentProcess.setWorkingDirectory( QFileInfo(_indenterDirctoryStr).absoluteFilePath() );
+ indentProcess.setWorkingDirectory( TQFileInfo(_indenterDirctoryStr).absoluteFilePath() );
- foreach ( QString suffix, QStringList() << "" << ".exe" << ".bat" << ".com" << ".sh" ) {
+ foreach ( TQString suffix, TQStringList() << "" << ".exe" << ".bat" << ".com" << ".sh" ) {
_indenterExecutableSuffix = suffix;
- _indenterExecutableCallString = QFileInfo(_indenterDirctoryStr).absoluteFilePath() + "/" + _indenterFileName;
+ _indenterExecutableCallString = TQFileInfo(_indenterDirctoryStr).absoluteFilePath() + "/" + _indenterFileName;
_indenterExecutableCallString += suffix;
// Only try to call the indenter, if the file exists.
- if ( QFile::exists(_indenterExecutableCallString) ) {
+ if ( TQFile::exists(_indenterExecutableCallString) ) {
// Only try to call the indenter directly if it is no php file
- if ( QFileInfo(_indenterExecutableCallString).suffix().toLower() != "php" ) {
+ if ( TQFileInfo(_indenterExecutableCallString).suffix().toLower() != "php" ) {
indentProcess.start( "\"" + _indenterExecutableCallString + + "\" " + _indenterShowHelpParameter );
if ( indentProcess.waitForFinished(2000) ) {
_indenterExecutableCallString = "\"" + _indenterExecutableCallString + "\"";
return true;
}
- else if ( indentProcess.error() == QProcess::Timedout ) {
+ else if ( indentProcess.error() == TQProcess::Timedout ) {
_indenterExecutableCallString = "\"" + _indenterExecutableCallString + "\"";
return true;
}
@@ -1370,18 +1370,18 @@ bool IndentHandler::createIndenterCallString() {
// Test for needed interpreters
// ----------------------------
// If the file could not be executed, try to find a shebang at its start or test if its a php file.
- QString interpreterName = "";
- QFile indenterExecutable( _indenterExecutableCallString );
+ TQString interpreterName = "";
+ TQFile indenterExecutable( _indenterExecutableCallString );
// If indenter executable file has .php as suffix, use php as default interpreter
- if ( QFileInfo(_indenterExecutableCallString).suffix().toLower() == "php" ) {
+ if ( TQFileInfo(_indenterExecutableCallString).suffix().toLower() == "php" ) {
interpreterName = "php -f";
}
// Else try to open the file and read the shebang.
- else if ( indenterExecutable.open(QFile::ReadOnly) ) {
+ else if ( indenterExecutable.open(TQFile::ReadOnly) ) {
// Read the first line of the file.
- QTextStream indenterExecutableContent(&indenterExecutable);
- QString firstLineOfIndenterExe = indenterExecutableContent.readLine(75);
+ TQTextStream indenterExecutableContent(&indenterExecutable);
+ TQString firstLineOfIndenterExe = indenterExecutableContent.readLine(75);
indenterExecutable.close();
// If the initial shebang is found, read the named intepreter. e.g. perl
@@ -1398,7 +1398,7 @@ bool IndentHandler::createIndenterCallString() {
if ( indentProcess.waitForFinished(2000) ) {
return true;
}
- else if ( indentProcess.error() == QProcess::Timedout ) {
+ else if ( indentProcess.error() == TQProcess::Timedout ) {
return true;
}
// now we know an interpreter is needed but it could not be called, so inform the user.
@@ -1415,23 +1415,23 @@ bool IndentHandler::createIndenterCallString() {
// If unsuccessful try if the indenter executable is a JavaScript file
// -------------------------------------------------------------------
_indenterExecutableSuffix = ".js";
- _indenterExecutableCallString = QFileInfo(_indenterDirctoryStr).absoluteFilePath() + "/" + _indenterFileName;
+ _indenterExecutableCallString = TQFileInfo(_indenterDirctoryStr).absoluteFilePath() + "/" + _indenterFileName;
_indenterExecutableCallString += _indenterExecutableSuffix;
- if ( QFile::exists(_indenterExecutableCallString) ) {
+ if ( TQFile::exists(_indenterExecutableCallString) ) {
return true;
}
// If unsuccessful try to call the indenter global, using some suffix
// ------------------------------------------------------------------
- foreach ( QString suffix, QStringList() << "" << ".exe" << ".bat" << ".com" << ".sh" ) {
+ foreach ( TQString suffix, TQStringList() << "" << ".exe" << ".bat" << ".com" << ".sh" ) {
_indenterExecutableSuffix = suffix;
_indenterExecutableCallString = _indenterFileName + suffix;
indentProcess.start( _indenterExecutableCallString + " " + _indenterShowHelpParameter );
if ( indentProcess.waitForFinished(2000) ) {
return true;
}
- else if ( indentProcess.error() == QProcess::Timedout ) {
+ else if ( indentProcess.error() == TQProcess::Timedout ) {
return true;
}
}
@@ -1439,12 +1439,12 @@ bool IndentHandler::createIndenterCallString() {
// If even globally calling the indenter fails, try calling .com and .exe via wine
// -------------------------------------------------------------------------------
- _indenterExecutableCallString = "\"" + QFileInfo(_indenterDirctoryStr).absoluteFilePath() + "/" + _indenterFileName;
+ _indenterExecutableCallString = "\"" + TQFileInfo(_indenterDirctoryStr).absoluteFilePath() + "/" + _indenterFileName;
- foreach ( QString suffix, QStringList() << ".exe" << ".com" ) {
+ foreach ( TQString suffix, TQStringList() << ".exe" << ".com" ) {
_indenterExecutableSuffix = suffix;
- if ( QFile::exists(_indenterDirctoryStr + "/" + _indenterFileName + suffix) ) {
- QProcess wineTestProcess;
+ if ( TQFile::exists(_indenterDirctoryStr + "/" + _indenterFileName + suffix) ) {
+ TQProcess wineTestProcess;
wineTestProcess.start("wine --version");
// if the process of wine was not callable assume that wine is not installed
if ( !wineTestProcess.waitForFinished(2000) ) {
@@ -1453,7 +1453,7 @@ bool IndentHandler::createIndenterCallString() {
return false;
}
else {
- _indenterExecutableCallString = "\"" + QFileInfo(_indenterDirctoryStr).absoluteFilePath() + "/";
+ _indenterExecutableCallString = "\"" + TQFileInfo(_indenterDirctoryStr).absoluteFilePath() + "/";
_indenterExecutableCallString += _indenterFileName + suffix + "\"";
_indenterExecutableCallString = "wine " + _indenterExecutableCallString;
@@ -1471,7 +1471,7 @@ bool IndentHandler::createIndenterCallString() {
/*!
\brief Returns a string that points to where the indenters manual can be found.
*/
-QString IndentHandler::getManual() {
+TQString IndentHandler::getManual() {
if ( _indenterSettings != NULL ) {
return _indenterSettings->value("header/manual").toString();
}
@@ -1485,8 +1485,8 @@ QString IndentHandler::getManual() {
\brief This slot gets the reference to the indenters manual and opens it.
*/
void IndentHandler::showIndenterManual() {
- QString manualReference = getManual();
- QDesktopServices::openUrl( manualReference );
+ TQString manualReference = getManual();
+ TQDesktopServices::openUrl( manualReference );
}
@@ -1497,29 +1497,29 @@ void IndentHandler::retranslateUi() {
_indenterSelectionCombobox->setToolTip( tr("<html><head><meta name=\"qrichtext\" content=\"1\" /></head><body style=\" white-space: pre-wrap; font-family:MS Shell Dlg; font-size:8.25pt; font-weight:400; font-style:normal; text-decoration:none;\"><p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">Shows the currently chosen indenters name and lets you choose other available indenters</p></body></html>") );
_indenterParameterHelpButton->setToolTip( tr("Brings you to the online manual of the currently selected indenter, where you can get further help on the possible parameters.") );
- _actionLoadIndenterConfigFile->setText(QApplication::translate("IndentHandler", "Load Indenter Config File", 0, QApplication::UnicodeUTF8));
- _actionLoadIndenterConfigFile->setStatusTip(QApplication::translate("IndentHandler", "Opens a file dialog to load the original config file of the indenter.", 0, QApplication::UnicodeUTF8));
- _actionLoadIndenterConfigFile->setShortcut(QApplication::translate("IndentHandler", "Alt+O", 0, QApplication::UnicodeUTF8));
+ _actionLoadIndenterConfigFile->setText(TQApplication::translate("IndentHandler", "Load Indenter Config File", 0, TQApplication::UnicodeUTF8));
+ _actionLoadIndenterConfigFile->setStatusTip(TQApplication::translate("IndentHandler", "Opens a file dialog to load the original config file of the indenter.", 0, TQApplication::UnicodeUTF8));
+ _actionLoadIndenterConfigFile->setShortcut(TQApplication::translate("IndentHandler", "Alt+O", 0, TQApplication::UnicodeUTF8));
- _actionSaveIndenterConfigFile->setText(QApplication::translate("IndentHandler", "Save Indenter Config File", 0, QApplication::UnicodeUTF8));
- _actionSaveIndenterConfigFile->setStatusTip(QApplication::translate("IndentHandler", "Opens a dialog to save the current indenter configuration to a file.", 0, QApplication::UnicodeUTF8));
- _actionSaveIndenterConfigFile->setShortcut(QApplication::translate("IndentHandler", "Alt+S", 0, QApplication::UnicodeUTF8));
+ _actionSaveIndenterConfigFile->setText(TQApplication::translate("IndentHandler", "Save Indenter Config File", 0, TQApplication::UnicodeUTF8));
+ _actionSaveIndenterConfigFile->setStatusTip(TQApplication::translate("IndentHandler", "Opens a dialog to save the current indenter configuration to a file.", 0, TQApplication::UnicodeUTF8));
+ _actionSaveIndenterConfigFile->setShortcut(TQApplication::translate("IndentHandler", "Alt+S", 0, TQApplication::UnicodeUTF8));
- _actionCreateShellScript->setText(QApplication::translate("IndentHandler", "Create Indenter Call Shell Script", 0, QApplication::UnicodeUTF8));
- _actionCreateShellScript->setToolTip(QApplication::translate("IndentHandler", "Create a shell script that calls the current selected indenter for formatting an as parameter given file with the current indent settings.", 0, QApplication::UnicodeUTF8));
- _actionCreateShellScript->setStatusTip(QApplication::translate("IndentHandler", "Create a shell script that calls the current selected indenter for formatting an as parameter given file with the current indent settings.", 0, QApplication::UnicodeUTF8));
+ _actionCreateShellScript->setText(TQApplication::translate("IndentHandler", "Create Indenter Call Shell Script", 0, TQApplication::UnicodeUTF8));
+ _actionCreateShellScript->setToolTip(TQApplication::translate("IndentHandler", "Create a shell script that calls the current selected indenter for formatting an as parameter given file with the current indent settings.", 0, TQApplication::UnicodeUTF8));
+ _actionCreateShellScript->setStatusTip(TQApplication::translate("IndentHandler", "Create a shell script that calls the current selected indenter for formatting an as parameter given file with the current indent settings.", 0, TQApplication::UnicodeUTF8));
- _actionResetIndenterParameters->setText(QApplication::translate("IndentHandler", "Reset indenter parameters", 0, QApplication::UnicodeUTF8));
- _actionResetIndenterParameters->setToolTip(QApplication::translate("IndentHandler", "Resets all indenter parameters to the default values.", 0, QApplication::UnicodeUTF8));
- _actionResetIndenterParameters->setStatusTip(QApplication::translate("IndentHandler", "Resets all indenter parameters to the default values.", 0, QApplication::UnicodeUTF8));
+ _actionResetIndenterParameters->setText(TQApplication::translate("IndentHandler", "Reset indenter parameters", 0, TQApplication::UnicodeUTF8));
+ _actionResetIndenterParameters->setToolTip(TQApplication::translate("IndentHandler", "Resets all indenter parameters to the default values.", 0, TQApplication::UnicodeUTF8));
+ _actionResetIndenterParameters->setStatusTip(TQApplication::translate("IndentHandler", "Resets all indenter parameters to the default values.", 0, TQApplication::UnicodeUTF8));
}
/*!
\brief Returns the name of the currently selected indenter.
*/
-QString IndentHandler::getCurrentIndenterName() {
- QString currentIndenterName = _indenterSelectionCombobox->currentText();
+TQString IndentHandler::getCurrentIndenterName() {
+ TQString currentIndenterName = _indenterSelectionCombobox->currentText();
// Remove the supported programming languages from indenters name, which are set in braces.
if ( currentIndenterName.indexOf("(") > 0 ) {
@@ -1537,9 +1537,9 @@ QString IndentHandler::getCurrentIndenterName() {
If the file was successfully opened the indent handler is called to load the settings and update itself.
*/
void IndentHandler::openConfigFileDialog() {
- QString configFilePath;
+ TQString configFilePath;
- configFilePath = QFileDialog::getOpenFileName( NULL, tr("Choose indenter config file"), getIndenterCfgFile(), "All files (*.*)" );
+ configFilePath = TQFileDialog::getOpenFileName( NULL, tr("Choose indenter config file"), getIndenterCfgFile(), "All files (*.*)" );
if (configFilePath != "") {
// If the config file was loaded successfully, inform any who is interested about it.
@@ -1555,15 +1555,15 @@ void IndentHandler::openConfigFileDialog() {
If the file already exists and it should be overwritten, a warning is shown before.
*/
void IndentHandler::saveasIndentCfgFileDialog() {
- QString fileExtensions = tr("All files")+" (*.*)";
+ TQString fileExtensions = tr("All files")+" (*.*)";
- //QString openedSourceFileContent = openFileDialog( tr("Choose source code file"), "./", fileExtensions );
- QString fileName = QFileDialog::getSaveFileName( this, tr("Save indent config file"), getIndenterCfgFile(), fileExtensions);
+ //TQString openedSourceFileContent = openFileDialog( tr("Choose source code file"), "./", fileExtensions );
+ TQString fileName = TQFileDialog::getSaveFileName( this, tr("Save indent config file"), getIndenterCfgFile(), fileExtensions);
if (fileName != "") {
- QFile::remove(fileName);
- QFile outCfgFile(fileName);
- outCfgFile.open( QFile::ReadWrite | QFile::Text );
+ TQFile::remove(fileName);
+ TQFile outCfgFile(fileName);
+ outCfgFile.open( TQFile::ReadWrite | TQFile::Text );
outCfgFile.write( getParameterString().toAscii() );
outCfgFile.close();
}
@@ -1577,19 +1577,19 @@ void IndentHandler::saveasIndentCfgFileDialog() {
other application and open a save dialog for saving the shell script.
*/
void IndentHandler::createIndenterCallShellScript() {
- QString shellScriptExtension;
+ TQString shellScriptExtension;
#if defined(Q_OS_WIN32)
shellScriptExtension = "bat";
#else
shellScriptExtension = "sh";
#endif
- QString fileExtensions = tr("Shell Script")+" (*."+shellScriptExtension+");;"+tr("All files")+" (*.*)";
+ TQString fileExtensions = tr("Shell Script")+" (*."+shellScriptExtension+");;"+tr("All files")+" (*.*)";
- QString currentIndenterName = getCurrentIndenterName();
+ TQString currentIndenterName = getCurrentIndenterName();
currentIndenterName = currentIndenterName.replace(" ", "_");
- QString shellScriptFileName = QFileDialog::getSaveFileName( this, tr("Save shell script"), "call_"+currentIndenterName+"."+shellScriptExtension, fileExtensions);
+ TQString shellScriptFileName = TQFileDialog::getSaveFileName( this, tr("Save shell script"), "call_"+currentIndenterName+"."+shellScriptExtension, fileExtensions);
// Saving has been canceled if the filename is empty
if ( shellScriptFileName.isEmpty() ) {
@@ -1597,28 +1597,28 @@ void IndentHandler::createIndenterCallShellScript() {
}
// Delete any old file, write the new contents and set executable permissions.
- QFile::remove(shellScriptFileName);
- QFile outSrcFile(shellScriptFileName);
- if ( outSrcFile.open( QFile::ReadWrite | QFile::Text ) ) {
- QString shellScriptConfigFilename = QFileInfo(shellScriptFileName).baseName() + "." + QFileInfo(_globalConfigFilename).suffix();
+ TQFile::remove(shellScriptFileName);
+ TQFile outSrcFile(shellScriptFileName);
+ if ( outSrcFile.open( TQFile::ReadWrite | TQFile::Text ) ) {
+ TQString shellScriptConfigFilename = TQFileInfo(shellScriptFileName).baseName() + "." + TQFileInfo(_globalConfigFilename).suffix();
// Get the content of the shell/batch script.
- QString indenterCallShellScript = generateShellScript(shellScriptConfigFilename);
+ TQString indenterCallShellScript = generateShellScript(shellScriptConfigFilename);
// Replace placeholder for script name in script template.
- indenterCallShellScript = indenterCallShellScript.replace( "__INDENTERCALLSTRINGSCRIPTNAME__", QFileInfo(shellScriptFileName).fileName() );
+ indenterCallShellScript = indenterCallShellScript.replace( "__INDENTERCALLSTRINGSCRIPTNAME__", TQFileInfo(shellScriptFileName).fileName() );
outSrcFile.write( indenterCallShellScript.toAscii() );
#if !defined(Q_OS_WIN32)
// For none Windows systems set the files executable flag
- outSrcFile.setPermissions( outSrcFile.permissions() | QFile::ExeOwner | QFile::ExeUser| QFile::ExeGroup );
+ outSrcFile.setPermissions( outSrcFile.permissions() | TQFile::ExeOwner | TQFile::ExeUser| TQFile::ExeGroup );
#endif
outSrcFile.close();
// Save the indenter config file to the same directory, where the shell srcipt was saved to,
// because the script will reference it there via "./".
if ( !_globalConfigFilename.isEmpty() ) {
- saveConfigFile( QFileInfo(shellScriptFileName).path() + "/" + shellScriptConfigFilename, getParameterString() );
+ saveConfigFile( TQFileInfo(shellScriptFileName).path() + "/" + shellScriptConfigFilename, getParameterString() );
}
}
}
@@ -1629,8 +1629,8 @@ void IndentHandler::createIndenterCallShellScript() {
but asks the user whether to do it really.
*/
void IndentHandler::resetIndenterParameter() {
- int messageBoxAnswer = QMessageBox::question(this, tr("Really reset parameters?"), tr("Do you really want to reset the indenter parameters to the default values?"), QMessageBox::Yes | QMessageBox::Abort );
- if ( messageBoxAnswer == QMessageBox::Yes ) {
+ int messageBoxAnswer = TQMessageBox::question(this, tr("Really reset parameters?"), tr("Do you really want to reset the indenter parameters to the default values?"), TQMessageBox::Yes | TQMessageBox::Abort );
+ if ( messageBoxAnswer == TQMessageBox::Yes ) {
resetToDefaultValues();
}
}
@@ -1641,18 +1641,18 @@ void IndentHandler::resetIndenterParameter() {
Is needed for use as Notepad++ plugin.
*/
-bool IndentHandler::event( QEvent *event ) {
- if ( event->type() == QEvent::WindowActivate ) {
+bool IndentHandler::event( TQEvent *event ) {
+ if ( event->type() == TQEvent::WindowActivate ) {
event->accept();
return true;
}
- else if ( event->type() == QEvent::WindowDeactivate ) {
+ else if ( event->type() == TQEvent::WindowDeactivate ) {
event->accept();
return true;
}
else {
event->ignore();
- return QWidget::event(event);
+ return TQWidget::event(event);
}
}
@@ -1697,7 +1697,7 @@ void IndentHandler::setWindowClosedCallback( void(*winClosedCallback)(void) ) {
Is needed for use as Notepad++ plugin.
*/
-void IndentHandler::closeEvent(QCloseEvent *event) {
+void IndentHandler::closeEvent(TQCloseEvent *event) {
if ( _windowClosedCallback != NULL ) {
_windowClosedCallback();
}
@@ -1716,7 +1716,7 @@ int IndentHandler::getIndenterId() {
void IndentHandler::updateDrawing() {
#ifdef UNIVERSALINDENTGUI_NPP_EXPORTS
if ( isVisible() ) {
- QRect savedGeometry = geometry();
+ TQRect savedGeometry = geometry();
setGeometry( savedGeometry.adjusted(0,0,0,1) );
repaint();
setGeometry( savedGeometry );
@@ -1724,10 +1724,10 @@ void IndentHandler::updateDrawing() {
#endif // UNIVERSALINDENTGUI_NPP_EXPORTS
}
-void IndentHandler::wheelEvent( QWheelEvent *event ) {
+void IndentHandler::wheelEvent( TQWheelEvent *event ) {
UNUSED_PARAMETER_WARNING_AVOID(event);
#ifdef UNIVERSALINDENTGUI_NPP_EXPORTS
- QWidget::wheelEvent( event );
+ TQWidget::wheelEvent( event );
updateDrawing();
#endif // UNIVERSALINDENTGUI_NPP_EXPORTS
}
@@ -1737,8 +1737,8 @@ void IndentHandler::wheelEvent( QWheelEvent *event ) {
\brief Converts characters < > and & in the \a text to HTML codes &lt &gt and &amp.
*/
//TODO: This function should go into a string helper/tool class/file.
-QString IndentHandler::encodeToHTML(const QString &text) {
- QString htmlText = text;
+TQString IndentHandler::encodeToHTML(const TQString &text) {
+ TQString htmlText = text;
htmlText.replace("&", "&amp;");
htmlText.replace("<", "&lt;");
htmlText.replace(">", "&gt;");