diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:48:06 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:48:06 +0000 |
commit | 47c8a359c5276062c4bc17f0e82410f29081b502 (patch) | |
tree | 2d54a5f60a5b74067632f9ef6df58c2bc38155e6 /kget/kmainwidget.cpp | |
parent | 6f82532777a35e0e60bbd2b290b2e93e646f349b (diff) | |
download | tdenetwork-47c8a359c5276062c4bc17f0e82410f29081b502.tar.gz tdenetwork-47c8a359c5276062c4bc17f0e82410f29081b502.zip |
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdenetwork@1157648 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kget/kmainwidget.cpp')
-rw-r--r-- | kget/kmainwidget.cpp | 246 |
1 files changed, 123 insertions, 123 deletions
diff --git a/kget/kmainwidget.cpp b/kget/kmainwidget.cpp index 420d44a1..01fc48c4 100644 --- a/kget/kmainwidget.cpp +++ b/kget/kmainwidget.cpp @@ -38,15 +38,15 @@ #include <net/if.h> #endif -#include <qclipboard.h> -#include <qregexp.h> -#include <qdragobject.h> -#include <qwhatsthis.h> -#include <qtooltip.h> -#include <qtimer.h> -#include <qdropsite.h> -#include <qpopupmenu.h> -#include <qfileinfo.h> +#include <tqclipboard.h> +#include <tqregexp.h> +#include <tqdragobject.h> +#include <tqwhatsthis.h> +#include <tqtooltip.h> +#include <tqtimer.h> +#include <tqdropsite.h> +#include <tqpopupmenu.h> +#include <tqfileinfo.h> #include <kinputdialog.h> #include <kprotocolinfo.h> @@ -87,7 +87,7 @@ #include <kio/authinfo.h> #include <kio/global.h> -#include <qiconset.h> +#include <tqiconset.h> #include "version.h" #include "slave.h" @@ -129,7 +129,7 @@ KMainWidget::KMainWidget(bool bStartDocked) { KConfig cfg( "kioslaverc", false, false); - cfg.setGroup(QString::null); + cfg.setGroup(TQString::null); cfg.writeEntry("AutoResume", true); cfg.sync(); } @@ -142,16 +142,16 @@ KMainWidget::KMainWidget(bool bStartDocked) kmain = this; // Set log time, needed for the name of log file - QDate date = QDateTime::currentDateTime().date(); - QTime time = QDateTime::currentDateTime().time(); - QString tmp; + TQDate date = TQDateTime::currentDateTime().date(); + TQTime time = TQDateTime::currentDateTime().time(); + TQString tmp; tmp.sprintf("log%d:%d:%d-%d:%d:%d", date.day(), date.month(), date.year(), time.hour(), time.minute(), time.second()); logFileName = locateLocal("appdata", "logs/"); logFileName += tmp; - lastClipboard = QApplication::clipboard()->text( QClipboard::Clipboard ).stripWhiteSpace(); + lastClipboard = TQApplication::clipboard()->text( QClipboard::Clipboard ).stripWhiteSpace(); // Load all settings from KConfig ksettings.load(); @@ -169,14 +169,14 @@ KMainWidget::KMainWidget(bool bStartDocked) setCentralWidget(myTransferList); - connect(kapp, SIGNAL(saveYourself()), SLOT(slotSaveYourself())); + connect(kapp, TQT_SIGNAL(saveYourself()), TQT_SLOT(slotSaveYourself())); // Enable dropping setAcceptDrops(true); // Setup connection timer - connectionTimer = new QTimer(this); - connect(connectionTimer, SIGNAL(timeout()), SLOT(slotCheckConnection())); + connectionTimer = new TQTimer(this); + connect(connectionTimer, TQT_SIGNAL(timeout()), TQT_SLOT(slotCheckConnection())); // setup socket for checking connection if ((_sock = sockets_open()) < 0) { @@ -189,9 +189,9 @@ KMainWidget::KMainWidget(bool bStartDocked) ksettings.b_offline=( !b_connected || ksettings.b_offlineMode ); // Setup animation timer - animTimer = new QTimer(this); + animTimer = new TQTimer(this); animCounter = 0; - connect(animTimer, SIGNAL(timeout()), SLOT(slotAnimTimeout())); + connect(animTimer, TQT_SIGNAL(timeout()), TQT_SLOT(slotAnimTimeout())); if (ksettings.b_useAnimation) { animTimer->start(400); @@ -200,18 +200,18 @@ KMainWidget::KMainWidget(bool bStartDocked) } // Setup transfer timer for scheduled downloads and checkQueue() - transferTimer = new QTimer(this); - connect(transferTimer, SIGNAL(timeout()), SLOT(slotTransferTimeout())); + transferTimer = new TQTimer(this); + connect(transferTimer, TQT_SIGNAL(timeout()), TQT_SLOT(slotTransferTimeout())); transferTimer->start(10000); // 10 secs time interval // Setup autosave timer - autosaveTimer = new QTimer(this); - connect(autosaveTimer, SIGNAL(timeout()), SLOT(slotAutosaveTimeout())); + autosaveTimer = new TQTimer(this); + connect(autosaveTimer, TQT_SIGNAL(timeout()), TQT_SLOT(slotAutosaveTimeout())); setAutoSave(); // Setup clipboard timer - clipboardTimer = new QTimer(this); - connect(clipboardTimer, SIGNAL(timeout()), SLOT(slotCheckClipboard())); + clipboardTimer = new TQTimer(this); + connect(clipboardTimer, TQT_SIGNAL(timeout()), TQT_SLOT(slotCheckClipboard())); if (ksettings.b_autoPaste) { clipboardTimer->start(1000); } @@ -221,7 +221,7 @@ KMainWidget::KMainWidget(bool bStartDocked) // Setup special windows kdrop = new DropTarget(this); kdock = new DockWidget(this); - connect(kdock, SIGNAL(quitSelected()), SLOT(slotQuit())); + connect(kdock, TQT_SIGNAL(quitSelected()), TQT_SLOT(slotQuit())); // Set geometry if (ksettings.mainPosition.x() != -1) { @@ -253,7 +253,7 @@ KMainWidget::KMainWidget(bool bStartDocked) setCaption(i18n("Offline"), false); log(i18n("Starting offline")); } else - setCaption(QString::null, false); + setCaption(TQString::null, false); m_paAutoPaste->setChecked(ksettings.b_autoPaste); m_paShowLog->setChecked(b_viewLogWindow); @@ -291,7 +291,7 @@ KMainWidget::~KMainWidget() } -void KMainWidget::log(const QString & message, bool statusbar) +void KMainWidget::log(const TQString & message, bool statusbar) { #ifdef _DEBUG sDebugIn <<" message= "<< message << endl; @@ -337,76 +337,76 @@ void KMainWidget::setupGUI() KActionCollection *coll = actionCollection(); - connect(myTransferList, SIGNAL(selectionChanged()), this, SLOT(slotUpdateActions())); - connect(myTransferList, SIGNAL(transferSelected(Transfer *)), this, SLOT(slotOpenIndividual())); - connect(myTransferList, SIGNAL(popupMenu(Transfer *)), this, SLOT(slotPopupMenu(Transfer *))); + connect(myTransferList, TQT_SIGNAL(selectionChanged()), this, TQT_SLOT(slotUpdateActions())); + connect(myTransferList, TQT_SIGNAL(transferSelected(Transfer *)), this, TQT_SLOT(slotOpenIndividual())); + connect(myTransferList, TQT_SIGNAL(popupMenu(Transfer *)), this, TQT_SLOT(slotPopupMenu(Transfer *))); // file actions - m_paOpenTransfer = KStdAction::open(this, SLOT(slotOpenTransfer()), coll, "open_transfer"); - m_paPasteTransfer = KStdAction::paste(this, SLOT(slotPasteTransfer()), coll, "paste_transfer"); + m_paOpenTransfer = KStdAction::open(this, TQT_SLOT(slotOpenTransfer()), coll, "open_transfer"); + m_paPasteTransfer = KStdAction::paste(this, TQT_SLOT(slotPasteTransfer()), coll, "paste_transfer"); - m_paExportTransfers = new KAction(i18n("&Export Transfer List..."), 0, this, SLOT(slotExportTransfers()), coll, "export_transfers"); - m_paImportTransfers = new KAction(i18n("&Import Transfer List..."), 0, this, SLOT(slotImportTransfers()), coll, "import_transfers"); + m_paExportTransfers = new KAction(i18n("&Export Transfer List..."), 0, this, TQT_SLOT(slotExportTransfers()), coll, "export_transfers"); + m_paImportTransfers = new KAction(i18n("&Import Transfer List..."), 0, this, TQT_SLOT(slotImportTransfers()), coll, "import_transfers"); - m_paImportText = new KAction(i18n("Import Text &File..."), 0, this, SLOT(slotImportTextFile()), coll, "import_text"); + m_paImportText = new KAction(i18n("Import Text &File..."), 0, this, TQT_SLOT(slotImportTextFile()), coll, "import_text"); - m_paQuit = KStdAction::quit(this, SLOT(slotQuit()), coll, "quit"); + m_paQuit = KStdAction::quit(this, TQT_SLOT(slotQuit()), coll, "quit"); // transfer actions - m_paCopy = new KAction(i18n("&Copy URL to Clipboard"), 0, this, SLOT(slotCopyToClipboard()), coll, "copy_url"); - m_paIndividual = new KAction(i18n("&Open Individual Window"), 0, this, SLOT(slotOpenIndividual()), coll, "open_individual"); + m_paCopy = new KAction(i18n("&Copy URL to Clipboard"), 0, this, TQT_SLOT(slotCopyToClipboard()), coll, "copy_url"); + m_paIndividual = new KAction(i18n("&Open Individual Window"), 0, this, TQT_SLOT(slotOpenIndividual()), coll, "open_individual"); - m_paMoveToBegin = new KAction(i18n("Move to &Beginning"), 0, this, SLOT(slotMoveToBegin()), coll, "move_begin"); + m_paMoveToBegin = new KAction(i18n("Move to &Beginning"), 0, this, TQT_SLOT(slotMoveToBegin()), coll, "move_begin"); - m_paMoveToEnd = new KAction(i18n("Move to &End"), 0, this, SLOT(slotMoveToEnd()), coll, "move_end"); + m_paMoveToEnd = new KAction(i18n("Move to &End"), 0, this, TQT_SLOT(slotMoveToEnd()), coll, "move_end"); #ifdef _DEBUG sDebug << "Loading pics" << endl; #endif - m_paResume = new KAction(i18n("&Resume"),"tool_resume", 0, this, SLOT(slotResumeCurrent()), coll, "resume"); - m_paPause = new KAction(i18n("&Pause"),"tool_pause", 0, this, SLOT(slotPauseCurrent()), coll, "pause"); - m_paDelete = new KAction(i18n("&Delete"),"editdelete", Qt::Key_Delete, this, SLOT(slotDeleteCurrent()), coll, "delete"); - m_paRestart = new KAction(i18n("Re&start"),"tool_restart", 0, this, SLOT(slotRestartCurrent()), coll, "restart"); + m_paResume = new KAction(i18n("&Resume"),"tool_resume", 0, this, TQT_SLOT(slotResumeCurrent()), coll, "resume"); + m_paPause = new KAction(i18n("&Pause"),"tool_pause", 0, this, TQT_SLOT(slotPauseCurrent()), coll, "pause"); + m_paDelete = new KAction(i18n("&Delete"),"editdelete", Qt::Key_Delete, this, TQT_SLOT(slotDeleteCurrent()), coll, "delete"); + m_paRestart = new KAction(i18n("Re&start"),"tool_restart", 0, this, TQT_SLOT(slotRestartCurrent()), coll, "restart"); - m_paQueue = new KRadioAction(i18n("&Queue"),"tool_queue", 0, this, SLOT(slotQueueCurrent()), coll, "queue"); - m_paTimer = new KRadioAction(i18n("&Timer"),"tool_timer", 0, this, SLOT(slotTimerCurrent()), coll, "timer"); - m_paDelay = new KRadioAction(i18n("De&lay"),"tool_delay", 0, this, SLOT(slotDelayCurrent()), coll, "delay"); + m_paQueue = new KRadioAction(i18n("&Queue"),"tool_queue", 0, this, TQT_SLOT(slotQueueCurrent()), coll, "queue"); + m_paTimer = new KRadioAction(i18n("&Timer"),"tool_timer", 0, this, TQT_SLOT(slotTimerCurrent()), coll, "timer"); + m_paDelay = new KRadioAction(i18n("De&lay"),"tool_delay", 0, this, TQT_SLOT(slotDelayCurrent()), coll, "delay"); m_paQueue->setExclusiveGroup("TransferMode"); m_paTimer->setExclusiveGroup("TransferMode"); m_paDelay->setExclusiveGroup("TransferMode"); // options actions - m_paUseAnimation = new KToggleAction(i18n("Use &Animation"), 0, this, SLOT(slotToggleAnimation()), coll, "toggle_animation"); - m_paExpertMode = new KToggleAction(i18n("&Expert Mode"),"tool_expert", 0, this, SLOT(slotToggleExpertMode()), coll, "expert_mode"); - m_paUseLastDir = new KToggleAction(i18n("&Use-Last-Folder Mode"),"tool_uselastdir", 0, this, SLOT(slotToggleUseLastDir()), coll, "use_last_dir"); - m_paAutoDisconnect = new KToggleAction(i18n("Auto-&Disconnect Mode"),"tool_disconnect", 0, this, SLOT(slotToggleAutoDisconnect()), coll, "auto_disconnect"); - m_paAutoShutdown = new KToggleAction(i18n("Auto-S&hutdown Mode"), "tool_shutdown", 0, this, SLOT(slotToggleAutoShutdown()), coll, "auto_shutdown"); - m_paOfflineMode = new KToggleAction(i18n("&Offline Mode"),"tool_offline_mode_off", 0, this, SLOT(slotToggleOfflineMode()), coll, "offline_mode"); - m_paAutoPaste = new KToggleAction(i18n("Auto-Pas&te Mode"),"tool_clipboard", 0, this, SLOT(slotToggleAutoPaste()), coll, "auto_paste"); + m_paUseAnimation = new KToggleAction(i18n("Use &Animation"), 0, this, TQT_SLOT(slotToggleAnimation()), coll, "toggle_animation"); + m_paExpertMode = new KToggleAction(i18n("&Expert Mode"),"tool_expert", 0, this, TQT_SLOT(slotToggleExpertMode()), coll, "expert_mode"); + m_paUseLastDir = new KToggleAction(i18n("&Use-Last-Folder Mode"),"tool_uselastdir", 0, this, TQT_SLOT(slotToggleUseLastDir()), coll, "use_last_dir"); + m_paAutoDisconnect = new KToggleAction(i18n("Auto-&Disconnect Mode"),"tool_disconnect", 0, this, TQT_SLOT(slotToggleAutoDisconnect()), coll, "auto_disconnect"); + m_paAutoShutdown = new KToggleAction(i18n("Auto-S&hutdown Mode"), "tool_shutdown", 0, this, TQT_SLOT(slotToggleAutoShutdown()), coll, "auto_shutdown"); + m_paOfflineMode = new KToggleAction(i18n("&Offline Mode"),"tool_offline_mode_off", 0, this, TQT_SLOT(slotToggleOfflineMode()), coll, "offline_mode"); + m_paAutoPaste = new KToggleAction(i18n("Auto-Pas&te Mode"),"tool_clipboard", 0, this, TQT_SLOT(slotToggleAutoPaste()), coll, "auto_paste"); - m_paPreferences = KStdAction::preferences(this, SLOT(slotPreferences()), coll); + m_paPreferences = KStdAction::preferences(this, TQT_SLOT(slotPreferences()), coll); - KStdAction::keyBindings(guiFactory(), SLOT(configureShortcuts()), coll); - KStdAction::configureToolbars(this, SLOT(slotConfigureToolbars()), coll); - KStdAction::configureNotifications(this, SLOT(slotConfigureNotifications()), coll); + KStdAction::keyBindings(guiFactory(), TQT_SLOT(configureShortcuts()), coll); + KStdAction::configureToolbars(this, TQT_SLOT(slotConfigureToolbars()), coll); + KStdAction::configureNotifications(this, TQT_SLOT(slotConfigureNotifications()), coll); - m_menubarAction = KStdAction::showMenubar(this, SLOT(slotShowMenubar()), coll, "settings_showmenubar" ); + m_menubarAction = KStdAction::showMenubar(this, TQT_SLOT(slotShowMenubar()), coll, "settings_showmenubar" ); m_menubarAction->setChecked( !menuBar()->isHidden() ); // view actions createStandardStatusBarAction(); - m_paShowLog = new KToggleAction(i18n("Show &Log Window"),"tool_logwindow", 0, this, SLOT(slotToggleLogWindow()), coll, "toggle_log"); + m_paShowLog = new KToggleAction(i18n("Show &Log Window"),"tool_logwindow", 0, this, TQT_SLOT(slotToggleLogWindow()), coll, "toggle_log"); m_paShowLog->setCheckedState(i18n("Hide &Log Window")); - m_paDropTarget = new KAction(i18n("Show Drop &Target"),"tool_drop_target", 0, this, SLOT(slotToggleDropTarget()), coll, "drop_target"); - m_paKonquerorIntegration = new KAction(i18n("Enable &KGet as Konqueror Download Manager"), "konqueror", 0, this, SLOT(slotKonquerorIntegration()), coll, "konqueror_integration"); + m_paDropTarget = new KAction(i18n("Show Drop &Target"),"tool_drop_target", 0, this, TQT_SLOT(slotToggleDropTarget()), coll, "drop_target"); + m_paKonquerorIntegration = new KAction(i18n("Enable &KGet as Konqueror Download Manager"), "konqueror", 0, this, TQT_SLOT(slotKonquerorIntegration()), coll, "konqueror_integration"); if (ksettings.b_KonquerorIntegration) { m_paKonquerorIntegration->setText(i18n("Disable &KGet as Konqueror Download Manager")); } menuHelp = new KHelpMenu(this, KGlobal::instance()->aboutData()); - KStdAction::whatsThis(menuHelp, SLOT(contextHelpActivated()), coll, "whats_this"); + KStdAction::whatsThis(menuHelp, TQT_SLOT(contextHelpActivated()), coll, "whats_this"); createGUI("kgetui.rc"); @@ -435,7 +435,7 @@ void KMainWidget::setupWhatsThis() sDebugIn << endl; #endif - QString tmp; + TQString tmp; tmp = i18n("<b>Resume</b> button starts selected transfers\n" "and sets their mode to <i>queued</i>."); m_paResume->setWhatsThis(tmp); @@ -510,7 +510,7 @@ void KMainWidget::slotConfigureToolbars() saveMainWindowSettings( KGlobal::config(), "MainWindow" ); KEditToolbar edit(factory()); - connect(&edit, SIGNAL( newToolbarConfig() ), this, SLOT( slotNewToolbarConfig() )); + connect(&edit, TQT_SIGNAL( newToolbarConfig() ), this, TQT_SLOT( slotNewToolbarConfig() )); edit.exec(); #ifdef _DEBUG @@ -540,8 +540,8 @@ void KMainWidget::slotImportTextFile() sDebugIn << endl; #endif - QString tmpFile; - QString list; + TQString tmpFile; + TQString list; int i, j; KURL filename = KFileDialog::getOpenURL(ksettings.lastDirectory); @@ -556,7 +556,7 @@ void KMainWidget::slotImportTextFile() i = 0; while ((j = list.find('\n', i)) != -1) { - QString newtransfer = list.mid(i, j - i); + TQString newtransfer = list.mid(i, j - i); addTransfer(newtransfer); i = j + 1; } @@ -648,8 +648,8 @@ void KMainWidget::writeTransfers(bool ask_for_name) sDebugIn << endl; #endif - QString str; - QString txt; + TQString str; + TQString txt; if (ask_for_name) txt = KFileDialog::getSaveFileName(ksettings.lastDirectory, i18n("*.kgt|*.kgt\n*|All Files")); @@ -805,12 +805,12 @@ void KMainWidget::slotDeleteCurrent() m_paPause->setEnabled(false); update(); TransferIterator it(myTransferList); - QValueList<QGuardedPtr<Transfer> > selectedItems; - QStringList itemNames; + TQValueList<TQGuardedPtr<Transfer> > selectedItems; + TQStringList itemNames; while (it.current()) { if (it.current()->isSelected()) { - selectedItems.append( QGuardedPtr<Transfer>( it.current() )); + selectedItems.append( TQGuardedPtr<Transfer>( it.current() )); itemNames.append( it.current()->getSrc().prettyURL() ); } ++it; @@ -823,7 +823,7 @@ void KMainWidget::slotDeleteCurrent() if (KMessageBox::warningContinueCancelList(this, i18n("Are you sure you want to delete these transfers?"), itemNames, i18n("Question"), KStdGuiItem::del(), - QString("multiple_delete_transfer")) + TQString("multiple_delete_transfer")) != KMessageBox::Continue) return; // keep 'em } @@ -831,7 +831,7 @@ void KMainWidget::slotDeleteCurrent() { if (KMessageBox::warningContinueCancel(this, i18n("Are you sure you want to delete this transfer?"), i18n("Question"), KStdGuiItem::del(), - QString("delete_transfer")) + TQString("delete_transfer")) != KMessageBox::Continue) return; } @@ -839,10 +839,10 @@ void KMainWidget::slotDeleteCurrent() // If we reach this, we want to delete all selected transfers // Some of them might have finished in the meantime tho. Good that - // we used a QGuardedPtr :) + // we used a TQGuardedPtr :) int transferFinishedMeanwhile = 0; - QValueListConstIterator<QGuardedPtr<Transfer> > lit = selectedItems.begin();; + TQValueListConstIterator<TQGuardedPtr<Transfer> > lit = selectedItems.begin();; while ( lit != selectedItems.end() ) { if ( *lit ) @@ -859,7 +859,7 @@ void KMainWidget::slotDeleteCurrent() KMessageBox::information(this, i18n("The transfer you wanted to delete completed before it could be deleted.", "%n transfers you wanted to delete completed before they could be deleted.", transferFinishedMeanwhile ), - QString::null, "completedBeforeDeletion" ); + TQString::null, "completedBeforeDeletion" ); #ifdef _DEBUG sDebugOut << endl; @@ -957,7 +957,7 @@ void KMainWidget::slotOpenTransfer() sDebugIn << endl; #endif - QString newtransfer; + TQString newtransfer; bool ok = false; #ifdef _DEBUG @@ -997,7 +997,7 @@ void KMainWidget::slotCheckClipboard() //sDebugIn << endl; #endif - QString clipData = QApplication::clipboard()->text( QClipboard::Clipboard ).stripWhiteSpace(); + TQString clipData = TQApplication::clipboard()->text( QClipboard::Clipboard ).stripWhiteSpace(); if (clipData != lastClipboard) { sDebug << "New clipboard event" << endl; @@ -1024,9 +1024,9 @@ void KMainWidget::slotPasteTransfer() sDebugIn << endl; #endif - QString newtransfer; + TQString newtransfer; - newtransfer = QApplication::clipboard()->text(); + newtransfer = TQApplication::clipboard()->text(); newtransfer = newtransfer.stripWhiteSpace(); if (!ksettings.b_expertMode) { @@ -1071,7 +1071,7 @@ void KMainWidget::addTransferEx(const KURL& url, const KURL& destFile) if ( !destURL.isValid() ) { // Setup destination - QString destDir = getSaveDirectoryFor( url.fileName() ); + TQString destDir = getSaveDirectoryFor( url.fileName() ); bool b_expertMode = ksettings.b_expertMode; bool bDestisMalformed = true; @@ -1079,7 +1079,7 @@ void KMainWidget::addTransferEx(const KURL& url, const KURL& destFile) { if (!b_expertMode) { // open the filedialog for confirmation - KFileDialog dlg( destDir, QString::null, + KFileDialog dlg( destDir, TQString::null, 0L, "save_as", true); dlg.setCaption(i18n("Save As")); dlg.setOperationMode(KFileDialog::Saving); @@ -1090,7 +1090,7 @@ void KMainWidget::addTransferEx(const KURL& url, const KURL& destFile) else dlg.setSelection(destURL.url()); - if ( dlg.exec() == QDialog::Rejected ) + if ( dlg.exec() == TQDialog::Rejected ) { #ifdef _DEBUG sDebugOut << endl; @@ -1114,7 +1114,7 @@ void KMainWidget::addTransferEx(const KURL& url, const KURL& destFile) //check if destination already exists if(KIO::NetAccess::exists(destURL, false, this)) { - if (KMessageBox::warningYesNo(this,i18n("Destination file \n%1\nalready exists.\nDo you want to overwrite it?").arg( destURL.prettyURL()), QString::null, i18n("Overwrite"), i18n("Do Not Overwrite") ) + if (KMessageBox::warningYesNo(this,i18n("Destination file \n%1\nalready exists.\nDo you want to overwrite it?").arg( destURL.prettyURL()), TQString::null, i18n("Overwrite"), i18n("Do Not Overwrite") ) == KMessageBox::Yes) { bDestisMalformed=false; @@ -1156,9 +1156,9 @@ void KMainWidget::addTransferEx(const KURL& url, const KURL& destFile) } -void KMainWidget::addTransfers( const KURL::List& src, const QString& destDir ) +void KMainWidget::addTransfers( const KURL::List& src, const TQString& destDir ) { - QValueList<KURLPair> urls_orig; + TQValueList<KURLPair> urls_orig; for ( KURL::List::ConstIterator it = src.begin(); it != src.end(); ++it ) { @@ -1181,7 +1181,7 @@ void KMainWidget::addTransfers( const KURL::List& src, const QString& destDir ) { // create a proper destination file from destDir KURL destURL = KURL::fromPathOrURL( destDir ); - QString fileName = urls_orig.first().src.fileName(); + TQString fileName = urls_orig.first().src.fileName(); // in case the fileName is empty, we simply ask for a filename in // addTransferEx. Do NOT attempt to use an empty filename, that @@ -1192,7 +1192,7 @@ void KMainWidget::addTransfers( const KURL::List& src, const QString& destDir ) destURL.setFileName( fileName ); if(KIO::NetAccess::exists(destURL, false, this)) { - if (KMessageBox::warningYesNo(this,i18n("Destination file \n%1\nalready exists.\nDo you want to overwrite it?").arg( destURL.prettyURL()), QString::null, i18n("Overwrite"), i18n("Do Not Overwrite") ) + if (KMessageBox::warningYesNo(this,i18n("Destination file \n%1\nalready exists.\nDo you want to overwrite it?").arg( destURL.prettyURL()), TQString::null, i18n("Overwrite"), i18n("Do Not Overwrite") ) == KMessageBox::Yes) { SafeDelete::deleteFile( destURL ); @@ -1213,8 +1213,8 @@ void KMainWidget::addTransfers( const KURL::List& src, const QString& destDir ) // multiple files -> ask for directory, not for every single filename bool dir_accepted = false; - QValueList<KURLPair>::Iterator it; - QValueList<KURLPair> urls; + TQValueList<KURLPair>::Iterator it; + TQValueList<KURLPair> urls; KURL::List urlsToDelete; while ( !dir_accepted ) { @@ -1223,7 +1223,7 @@ void KMainWidget::addTransfers( const KURL::List& src, const QString& destDir ) // we want to start again with the original list dir_accepted = true; //Set to false later when Cancel is pressed KURL dest; - if ( destDir.isEmpty() || !QFileInfo( destDir ).isDir() ) + if ( destDir.isEmpty() || !TQFileInfo( destDir ).isDir() ) { if ( !destDir.isEmpty() ) dest.setPath( destDir ); @@ -1231,9 +1231,9 @@ void KMainWidget::addTransfers( const KURL::List& src, const QString& destDir ) dest.setPath( getSaveDirectoryFor( src.first().fileName() ) ); // ask in any case, when destDir is empty - if ( destDir.isEmpty() || !QFileInfo( dest.path() ).isDir() ) + if ( destDir.isEmpty() || !TQFileInfo( dest.path() ).isDir() ) { - QString dir = KFileDialog::getExistingDirectory( dest.path() ); + TQString dir = KFileDialog::getExistingDirectory( dest.path() ); if ( dir.isEmpty() ) // aborted return; @@ -1260,7 +1260,7 @@ void KMainWidget::addTransfers( const KURL::List& src, const QString& destDir ) } (*it).dest = dest; - QString fileName = (*it).src.fileName(); + TQString fileName = (*it).src.fileName(); if ( fileName.isEmpty() ) // simply use the full url as filename fileName = KURL::encode_string_no_slash( (*it).src.prettyURL() ); @@ -1268,15 +1268,15 @@ void KMainWidget::addTransfers( const KURL::List& src, const QString& destDir ) if( KIO::NetAccess::exists((*it).dest, false, this)) { - QString newdest; + TQString newdest; if (skip_all) result = KIO::R_SKIP; else if( overwrite_all ) result = KIO::R_OVERWRITE; else { - QFileInfo finfo( (*it).dest.path() ); - QString caption = i18n( "File Already exists" ) + " - KGet"; + TQFileInfo finfo( (*it).dest.path() ); + TQString caption = i18n( "File Already exists" ) + " - KGet"; result = KIO::open_RenameDlg( caption, (*it).src.url(), (*it).dest.url(), KIO::RenameDlg_Mode(KIO::M_OVERWRITE|KIO::M_SKIP|KIO::M_MULTI), newdest, (KIO::filesize_t) -1, (KIO::filesize_t)finfo.size(), (time_t) -1, (time_t) -1, (time_t) -1, finfo.lastModified().toTime_t()); } switch (result) @@ -1327,7 +1327,7 @@ void KMainWidget::addTransfers( const KURL::List& src, const QString& destDir ) checkQueue(); } -void KMainWidget::addTransfer(const QString& src) +void KMainWidget::addTransfer(const TQString& src) { #ifdef _DEBUG sDebugIn << endl; @@ -1445,7 +1445,7 @@ void KMainWidget::slotTransferTimeout() for (; it.current(); ++it) { item = it.current(); - if (item->getMode() == Transfer::MD_SCHEDULED && item->getStartTime() <= QDateTime::currentDateTime()) { + if (item->getMode() == Transfer::MD_SCHEDULED && item->getStartTime() <= TQDateTime::currentDateTime()) { item->setMode(Transfer::MD_QUEUED); flag = true; } @@ -1455,7 +1455,7 @@ void KMainWidget::slotTransferTimeout() checkQueue(); } - if (ksettings.b_autoDisconnect && ksettings.b_timedDisconnect && ksettings.disconnectTime <= QTime::currentTime() && ksettings.disconnectDate == QDate::currentDate()) { + if (ksettings.b_autoDisconnect && ksettings.b_timedDisconnect && ksettings.disconnectTime <= TQTime::currentTime() && ksettings.disconnectDate == TQDate::currentDate()) { onlineDisconnect(); } @@ -1489,7 +1489,7 @@ void KMainWidget::slotStatusChanged(Transfer * item, int _operation) case Transfer::OP_FINISHED: { - QString srcurl = item->getSrc().prettyURL(); + TQString srcurl = item->getSrc().prettyURL(); if (ksettings.b_removeOnSuccess && !item->keepDialogOpen() ) { delete item; @@ -1551,13 +1551,13 @@ void KMainWidget::slotStatusChanged(Transfer * item, int _operation) } -void KMainWidget::dragEnterEvent(QDragEnterEvent * event) +void KMainWidget::dragEnterEvent(TQDragEnterEvent * event) { #ifdef _DEBUG //sDebugIn << endl; #endif - event->accept(KURLDrag::canDecode(event) || QTextDrag::canDecode(event)); + event->accept(KURLDrag::canDecode(event) || TQTextDrag::canDecode(event)); #ifdef _DEBUG sDebugOut << endl; @@ -1565,18 +1565,18 @@ void KMainWidget::dragEnterEvent(QDragEnterEvent * event) } -void KMainWidget::dropEvent(QDropEvent * event) +void KMainWidget::dropEvent(TQDropEvent * event) { #ifdef _DEBUG //sDebugIn << endl; #endif KURL::List list; - QString str; + TQString str; if (KURLDrag::decode(event, list)) { addTransfers(list); - } else if (QTextDrag::decode(event, str)) { + } else if (TQTextDrag::decode(event, str)) { addTransfer(str); } sDebugOut << endl; @@ -1592,8 +1592,8 @@ void KMainWidget::slotCopyToClipboard() Transfer *item = (Transfer *) myTransferList->currentItem(); if (item) { - QString url = item->getSrc().url(); - QClipboard *cb = QApplication::clipboard(); + TQString url = item->getSrc().url(); + QClipboard *cb = TQApplication::clipboard(); cb->setText( url, QClipboard::Selection ); cb->setText( url, QClipboard::Clipboard); myTransferList->clearSelection(); @@ -1766,7 +1766,7 @@ void KMainWidget::slotToggleOfflineMode() m_paOfflineMode->setIconSet(LOAD_ICON("tool_offline_mode_off")); } else { log(i18n("Offline mode off.")); - setCaption(QString::null, false); + setCaption(TQString::null, false); m_paOfflineMode->setIconSet(LOAD_ICON("tool_offline_mode_on")); } @@ -1923,7 +1923,7 @@ void KMainWidget::slotKonquerorIntegration() ksettings.b_KonquerorIntegration=!ksettings.b_KonquerorIntegration; KConfig cfg("konquerorrc", false, false); cfg.setGroup("HTML Settings"); - cfg.writePathEntry("DownloadManager",QString((bIsKonquiEnable)?"kget":"")); + cfg.writePathEntry("DownloadManager",TQString((bIsKonquiEnable)?"kget":"")); cfg.sync(); if (bIsKonquiEnable) { @@ -1953,8 +1953,8 @@ void KMainWidget::slotPopupMenu(Transfer * item) slotUpdateActions(); // popup transfer menu at the position - QWidget *menu = guiFactory()->container("transfer",this); - ((QPopupMenu *) menu)->popup(QCursor::pos()); + TQWidget *menu = guiFactory()->container("transfer",this); + ((TQPopupMenu *) menu)->popup(TQCursor::pos()); #ifdef _DEBUG @@ -2144,7 +2144,7 @@ void KMainWidget::updateStatusBar() #endif Transfer *item; - QString tmpstr; + TQString tmpstr; int totalFiles = 0; KIO::filesize_t totalSize = 0; @@ -2221,7 +2221,7 @@ void KMainWidget::onlineDisconnect() } } log(i18n("Disconnecting...")); - system(QFile::encodeName(ksettings.disconnectCommand)); + system(TQFile::encodeName(ksettings.disconnectCommand)); #ifdef _DEBUG sDebugOut << endl; @@ -2239,7 +2239,7 @@ void KMainWidget::slotCheckConnection() if (b_connected != old) { if (b_connected) { log(i18n("We are online.")); - setCaption(QString::null, false); + setCaption(TQString::null, false); ksettings.b_offline=ksettings.b_offlineMode; checkQueue(); } else { @@ -2351,7 +2351,7 @@ static int sockets_open() /** No descriptions */ -void KMainWidget::customEvent(QCustomEvent * _e) +void KMainWidget::customEvent(TQCustomEvent * _e) { #ifdef _DEBUG //sDebugIn << endl; @@ -2433,16 +2433,16 @@ void KMainWidget::customEvent(QCustomEvent * _e) #endif } -QString KMainWidget::getSaveDirectoryFor( const QString& filename ) const +TQString KMainWidget::getSaveDirectoryFor( const TQString& filename ) const { // first set destination directory to current directory ( which is also last used ) - QString destDir = ksettings.lastDirectory; + TQString destDir = ksettings.lastDirectory; if (!ksettings.b_useLastDir) { // check wildcards for default directory DirList::Iterator it; for (it = ksettings.defaultDirList.begin(); it != ksettings.defaultDirList.end(); ++it) { - QRegExp rexp((*it).extRegexp); + TQRegExp rexp((*it).extRegexp); rexp.setWildcard(true); |