diff options
author | Michele Calgaro <[email protected]> | 2022-07-16 15:44:05 +0900 |
---|---|---|
committer | Michele Calgaro <[email protected]> | 2022-07-16 15:44:05 +0900 |
commit | a30a266067d9d952edc91305bef757557c03717e (patch) | |
tree | 7bcabd84594f751001c66b16f3c42a8d459b7773 /src/debugging | |
parent | d017bd37253ae35b29d82e3277b9adcbb4517dd0 (diff) | |
download | universal-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 <[email protected]>
Diffstat (limited to 'src/debugging')
-rwxr-xr-x | src/debugging/TSLogger.cpp | 74 | ||||
-rwxr-xr-x | src/debugging/TSLogger.h | 18 | ||||
-rwxr-xr-x | src/debugging/TSLoggerDialog.ui | 22 |
3 files changed, 57 insertions, 57 deletions
diff --git a/src/debugging/TSLogger.cpp b/src/debugging/TSLogger.cpp index a13113e..b0f280a 100755 --- a/src/debugging/TSLogger.cpp +++ b/src/debugging/TSLogger.cpp @@ -22,13 +22,13 @@ #include "SettingsPaths.h" -#include <tqdatetime.h> -#include <tqfile.h> -#include <tqfileinfo.h> -#include <tqurl.h> -#include <tqtextstream.h> +#include <tntqdatetime.h> +#include <tntqfile.h> +#include <tntqfileinfo.h> +#include <tntqurl.h> +#include <tntqtextstream.h> #include <tqdesktopservices.h> -#include <tqmessagebox.h> +#include <tntqmessagebox.h> #include <ctime> @@ -65,9 +65,9 @@ TSLogger* TSLogger::getInstance(int verboseLevel) { */ TSLogger* TSLogger::getInstance() { #ifdef _DEBUG - return TSLogger::getInstance(QtDebugMsg); + return TSLogger::getInstance(TQtDebugMsg); #else - return TSLogger::getInstance(QtWarningMsg); + return TSLogger::getInstance(TQtWarningMsg); #endif } @@ -76,13 +76,13 @@ TSLogger* TSLogger::getInstance() { \brief Initializes the dialog and sets the path to the log file in the systems temporary directory. Sets the default verbose level to warning level. */ -TSLogger::TSLogger(int verboseLevel) : QDialog() { +TSLogger::TSLogger(int verboseLevel) : TQDialog() { _TSLoggerDialogForm = new Ui::TSLoggerDialog(); _TSLoggerDialogForm->setupUi(this); #ifdef _DEBUG - _verboseLevel = QtDebugMsg; + _verboseLevel = TQtDebugMsg; #else - _verboseLevel = QtMsgType(verboseLevel); + _verboseLevel = TQtMsgType(verboseLevel); #endif _logFileInitState = NOTINITIALZED; @@ -90,7 +90,7 @@ TSLogger::TSLogger(int verboseLevel) : QDialog() { connect( _TSLoggerDialogForm->openLogFileFolderToolButton, SIGNAL(clicked()), this, SLOT(openLogFileFolder()) ); // Make the main application not to wait for the logging window to close. - setAttribute(Qt::WA_QuitOnClose, false); + setAttribute(TQt::WA_QuitOnClose, false); } @@ -99,15 +99,15 @@ TSLogger::TSLogger(int verboseLevel) : QDialog() { Only messages whos \a type have a higher priority than the set verbose level are logged. */ -void TSLogger::messageHandler(QtMsgType type, const char *msg) { +void TSLogger::messageHandler(TQtMsgType type, const char *msg) { if ( _instance == NULL ) _instance = TSLogger::getInstance(); /* - QMessageBox messageBox; - QString messageBoxText = QString::fromUtf8( msg ); + TQMessageBox messageBox; + TQString messageBoxText = TQString::fromUtf8( msg ); messageBox.setText( messageBoxText ); - messageBox.setWindowModality( Qt::ApplicationModal ); + messageBox.setWindowModality( TQt::ApplicationModal ); messageBox.exec(); */ @@ -116,22 +116,22 @@ void TSLogger::messageHandler(QtMsgType type, const char *msg) { return; // Init log message with prepended date and time. - QString message = QDateTime::currentDateTime().toString(); + TQString message = TQDateTime::currentDateTime().toString(); - // Depending on the QtMsgType prepend a different colored Debug, Warning, Critical or Fatal. + // Depending on the TQtMsgType prepend a different colored Debug, Warning, Critical or Fatal. switch (type) { - case QtDebugMsg : + case TQtDebugMsg : message += " <span style=\"font-weight:bold; color:black;\">Debug:</span> "; break; - case QtWarningMsg : + case TQtWarningMsg : message += " <span style=\"font-weight:bold; color:gold;\">Warning:</span> "; break; - case QtCriticalMsg : + case TQtCriticalMsg : message += "<span style=\"font-weight:bold; color:red;\">Critical:</span> "; break; - case QtFatalMsg : + case TQtFatalMsg : message += " <span style=\"font-weight:bold; color:#D60000;\">Fatal:</span> "; - // This one is no Qt message type, but can be used to send info messages to the log + // This one is no TQt message type, but can be used to send info messages to the log // by calling TSLogger::messageHandler() directly. case TSLoggerInfoMsg : message += " <span style=\"font-weight:bold; color:darkgray;\">Info:</span> "; @@ -139,7 +139,7 @@ void TSLogger::messageHandler(QtMsgType type, const char *msg) { } // Append the to UTF-8 back converted message parameter. - message += QString::fromUtf8( msg ) + "<br/>\n"; + message += TQString::fromUtf8( msg ) + "<br/>\n"; // Write the message to the log windows text edit. _instance->_TSLoggerDialogForm->logTextEdit->append( message ); @@ -148,7 +148,7 @@ void TSLogger::messageHandler(QtMsgType type, const char *msg) { _instance->writeToLogFile( message ); // In case of a fatal error abort the application. - if ( type == QtFatalMsg ) + if ( type == TQtFatalMsg ) abort(); } @@ -159,11 +159,11 @@ void TSLogger::messageHandler(QtMsgType type, const char *msg) { */ void TSLogger::setVerboseLevel(int level) { if ( level < 0 ) - _verboseLevel = QtDebugMsg; + _verboseLevel = TQtDebugMsg; if ( level > 3 ) - _verboseLevel = QtFatalMsg; + _verboseLevel = TQtFatalMsg; else - _verboseLevel = QtMsgType(level); + _verboseLevel = TQtMsgType(level); } @@ -182,29 +182,29 @@ void TSLogger::deleteInstance() { \brief Opens the folder that contains the created log file with the name "UiGUI_log.html". */ void TSLogger::openLogFileFolder() { - QDesktopServices::openUrl( QFileInfo( _logFile ).absolutePath() ); + TQDesktopServices::openUrl( TQFileInfo( _logFile ).absolutePath() ); } /*! \brief Writes the \a message to the used log file. */ -void TSLogger::writeToLogFile(const QString &message) { +void TSLogger::writeToLogFile(const TQString &message) { // If the file where all logging messages should go to isn't initilized yet, do that now. if ( _logFileInitState == NOTINITIALZED ) { _logFileInitState = INITIALIZING; - // On different systems it may be that "QDir::tempPath()" ends with a "/" or not. So check this. + // On different systems it may be that "TQDir::tempPath()" ends with a "/" or not. So check this. // Remove any trailing slashes. - QString tempPath = QFileInfo( SettingsPaths::getTempPath() ).absolutePath(); + TQString tempPath = TQFileInfo( SettingsPaths::getTempPath() ).absolutePath(); while ( tempPath.right(1) == "/" ) { tempPath.chop(1); } // To make the temporary log file invulnerable against file symbolic link hacks // append the current date and time up to milliseconds to its name and a random character. - QString logFileName = "UiGUI_log_" + QDateTime::currentDateTime().toString("yyyyMMdd"); - logFileName += "-" + QDateTime::currentDateTime().toString("hhmmsszzz"); + TQString logFileName = "UiGUI_log_" + TQDateTime::currentDateTime().toString("yyyyMMdd"); + logFileName += "-" + TQDateTime::currentDateTime().toString("hhmmsszzz"); // By random decide whether to append a number or an upper or lower case character. qsrand( time(NULL) ); unsigned char randomChar; @@ -222,7 +222,7 @@ void TSLogger::writeToLogFile(const QString &message) { randomChar = qrand() % 26 + 'a'; break; } - logFileName += "_" + QString(randomChar) + ".html"; + logFileName += "_" + TQString(randomChar) + ".html"; _logFile.setFileName( tempPath + "/" + logFileName ); @@ -238,8 +238,8 @@ void TSLogger::writeToLogFile(const QString &message) { // If the logging file is initialzed, write all messages contained in the message queue into the file. if ( _logFileInitState == INITIALZED ) { // Write/append the log message to the log file. - if ( _logFile.open(QIODevice::WriteOnly | QIODevice::Text | QIODevice::Append) ) { - QTextStream out(&_logFile); + if ( _logFile.open(TQIODevice::WriteOnly | TQIODevice::Text | TQIODevice::Append) ) { + TQTextStream out(&_logFile); while ( !_messageQueue.isEmpty() ) { out << _messageQueue.takeFirst() << "\n"; diff --git a/src/debugging/TSLogger.h b/src/debugging/TSLogger.h index 97268f7..39abcaa 100755 --- a/src/debugging/TSLogger.h +++ b/src/debugging/TSLogger.h @@ -20,8 +20,8 @@ #ifndef TSLogger_H #define TSLogger_H -#include <tqdialog.h> -#include <tqfile.h> +#include <tntqdialog.h> +#include <tntqfile.h> namespace Ui { class TSLoggerDialog; @@ -29,16 +29,16 @@ namespace Ui { namespace tschweitzer { namespace debugging { -#define TSLoggerInfoMsg QtMsgType(4) +#define TSLoggerInfoMsg TQtMsgType(4) -class TSLogger : public QDialog +class TSLogger : public TQDialog { Q_OBJECT public: static TSLogger* getInstance(int verboseLevel); static TSLogger* getInstance(); - static void messageHandler(QtMsgType type, const char *msg); + static void messageHandler(TQtMsgType type, const char *msg); static void deleteInstance(); void setVerboseLevel(int level); @@ -50,12 +50,12 @@ private: enum LogFileInitState { NOTINITIALZED, INITIALIZING, INITIALZED } _logFileInitState; TSLogger(int verboseLevel); - void writeToLogFile(const QString &message); + void writeToLogFile(const TQString &message); static TSLogger* _instance; - QtMsgType _verboseLevel; - QFile _logFile; - QStringList _messageQueue; + TQtMsgType _verboseLevel; + TQFile _logFile; + TQStringList _messageQueue; }; }} // namespace tschweitzer::debugging diff --git a/src/debugging/TSLoggerDialog.ui b/src/debugging/TSLoggerDialog.ui index 3a83146..1956229 100755 --- a/src/debugging/TSLoggerDialog.ui +++ b/src/debugging/TSLoggerDialog.ui @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="UTF-8"?> <ui version="4.0"> <class>TSLoggerDialog</class> - <widget class="QDialog" name="TSLoggerDialog"> + <widget class="TQDialog" name="TSLoggerDialog"> <property name="geometry"> <rect> <x>0</x> @@ -17,25 +17,25 @@ <iconset resource="../resources/Icons.qrc"> <normaloff>:/mainWindow/document-properties.png</normaloff>:/mainWindow/document-properties.png</iconset> </property> - <layout class="QVBoxLayout"> + <layout class="TQVBoxLayout"> <item> - <widget class="QLabel" name="label"> + <widget class="TQLabel" name="label"> <property name="text"> <string>Logged messages</string> </property> </widget> </item> <item> - <widget class="QTextEdit" name="logTextEdit"> + <widget class="TQTextEdit" name="logTextEdit"> <property name="readOnly"> <bool>true</bool> </property> </widget> </item> <item> - <layout class="QHBoxLayout" name="horizontalLayout"> + <layout class="TQHBoxLayout" name="horizontalLayout"> <item> - <widget class="QToolButton" name="cleanUpToolButton"> + <widget class="TQToolButton" name="cleanUpToolButton"> <property name="toolTip"> <string>Clear log</string> </property> @@ -49,7 +49,7 @@ </widget> </item> <item> - <widget class="QToolButton" name="openLogFileFolderToolButton"> + <widget class="TQToolButton" name="openLogFileFolderToolButton"> <property name="toolTip"> <string>Open folder containing log file.</string> </property> @@ -65,7 +65,7 @@ <item> <spacer name="horizontalSpacer"> <property name="orientation"> - <enum>Qt::Horizontal</enum> + <enum>TQt::Horizontal</enum> </property> <property name="sizeHint" stdset="0"> <size> @@ -76,9 +76,9 @@ </spacer> </item> <item> - <widget class="QDialogButtonBox" name="buttonBox"> + <widget class="TQDialogButtonBox" name="buttonBox"> <property name="standardButtons"> - <set>QDialogButtonBox::Close</set> + <set>TQDialogButtonBox::Close</set> </property> </widget> </item> @@ -108,7 +108,7 @@ </connection> <connection> <sender>buttonBox</sender> - <signal>clicked(QAbstractButton*)</signal> + <signal>clicked(TQAbstractButton*)</signal> <receiver>TSLoggerDialog</receiver> <slot>close()</slot> <hints> |