From 808e453c56036211f57482ed847d54aca01bba68 Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Thu, 15 Dec 2011 15:49:40 -0600 Subject: Rename a number of old tq methods that are no longer tq specific --- kget/kmainwidget.cpp | 96 ++++++++++++++++++++++++++-------------------------- 1 file changed, 48 insertions(+), 48 deletions(-) (limited to 'kget/kmainwidget.cpp') diff --git a/kget/kmainwidget.cpp b/kget/kmainwidget.cpp index ad5fa4a9..3271f0d0 100644 --- a/kget/kmainwidget.cpp +++ b/kget/kmainwidget.cpp @@ -38,7 +38,7 @@ #include #endif -#include +#include #include #include #include @@ -142,8 +142,8 @@ KMainWidget::KMainWidget(bool bStartDocked) kmain = this; // Set log time, needed for the name of log file - TQDate date = TQDateTime::tqcurrentDateTime().date(); - TQTime time = TQDateTime::tqcurrentDateTime().time(); + 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()); @@ -151,7 +151,7 @@ KMainWidget::KMainWidget(bool bStartDocked) logFileName = locateLocal("appdata", "logs/"); logFileName += tmp; - lastClipboard = TQApplication::tqclipboard()->text( TQClipboard::Clipboard ).stripWhiteSpace(); + lastClipboard = TQApplication::clipboard()->text( TQClipboard::Clipboard ).stripWhiteSpace(); // Load all settings from KConfig ksettings.load(); @@ -223,7 +223,7 @@ KMainWidget::KMainWidget(bool bStartDocked) kdock = new DockWidget(this); connect(kdock, TQT_SIGNAL(quitSelected()), TQT_SLOT(slotQuit())); - // Set tqgeometry + // Set geometry if (ksettings.mainPosition.x() != -1) { resize(ksettings.mainSize); move(ksettings.mainPosition); @@ -411,11 +411,11 @@ void KMainWidget::setupGUI() createGUI("kgetui.rc"); // setup statusbar - statusBar()->insertFixedItem(i18n(" Transfers: %1 ").tqarg(99), ID_TOTAL_TRANSFERS); - statusBar()->insertFixedItem(i18n(" Files: %1 ").tqarg(555), ID_TOTAL_FILES); - statusBar()->insertFixedItem(i18n(" Size: %1 KB ").tqarg("134.56"), ID_TOTAL_SIZE); - statusBar()->insertFixedItem(i18n(" Time: %1 ").tqarg(KIO::convertSeconds(0)), ID_TOTAL_TIME); - statusBar()->insertFixedItem(i18n(" %1 KB/s ").tqarg("123.34"), ID_TOTAL_SPEED); + statusBar()->insertFixedItem(i18n(" Transfers: %1 ").arg(99), ID_TOTAL_TRANSFERS); + statusBar()->insertFixedItem(i18n(" Files: %1 ").arg(555), ID_TOTAL_FILES); + statusBar()->insertFixedItem(i18n(" Size: %1 KB ").arg("134.56"), ID_TOTAL_SIZE); + statusBar()->insertFixedItem(i18n(" Time: %1 ").arg(KIO::convertSeconds(0)), ID_TOTAL_TIME); + statusBar()->insertFixedItem(i18n(" %1 KB/s ").arg("123.34"), ID_TOTAL_SPEED); setAutoSaveSettings( "MainWindow", false /*Settings takes care of size & pos & state */ ); @@ -485,7 +485,7 @@ void KMainWidget::setupWhatsThis() tmp = i18n("Auto paste button toggles the auto-paste mode\n" "on and off.\n" "\n" "When set, KGet will periodically scan the clipboard\n" "for URLs and paste them automatically."); m_paAutoPaste->setWhatsThis(tmp); - tmp = i18n("Drop target button toggles the window style\n" "between a normal window and a drop target.\n" "\n" "When set, the main window will be hidden and\n" "instead a small tqshaped window will appear.\n" "\n" "You can show/hide a normal window with a simple click\n" "on a tqshaped window."); + tmp = i18n("Drop target button toggles the window style\n" "between a normal window and a drop target.\n" "\n" "When set, the main window will be hidden and\n" "instead a small shaped window will appear.\n" "\n" "You can show/hide a normal window with a simple click\n" "on a shaped window."); m_paDropTarget->setWhatsThis(tmp); /* tmp = i18n("Dock widget button toggles the window style\n" "between a normal window and a docked widget.\n" "\n" "When set, the main window will be hidden and\n" "instead a docked widget will appear on the panel.\n" "\n" "You can show/hide a normal window by simply clicking\n" "on a docked widget."); @@ -708,7 +708,7 @@ void KMainWidget::slotQuit() for (; it.current(); ++it) { item = it.current(); - if (item->gettqStatus() == Transfer::ST_RUNNING && !ksettings.b_expertMode) { + if (item->getStatus() == Transfer::ST_RUNNING && !ksettings.b_expertMode) { if (KMessageBox::warningContinueCancel(this, i18n("Some transfers are still running.\nAre you sure you want to quit KGet?"), i18n("Warning"), KStdGuiItem::quit()) != KMessageBox::Continue) { #ifdef _DEBUG sDebugOut << endl; @@ -876,10 +876,10 @@ void KMainWidget::stopAll() log(i18n("Stopping all jobs"), false); TransferIterator it(myTransferList); - Transfer::TransfertqStatus tqStatus; + Transfer::TransferStatus Status; for (; it.current(); ++it) { - tqStatus = it.current()->gettqStatus(); - if (tqStatus == Transfer::ST_TRYING || tqStatus == Transfer::ST_RUNNING) + Status = it.current()->getStatus(); + if (Status == Transfer::ST_TRYING || Status == Transfer::ST_RUNNING) it.current()->slotStop(); } slotUpdateActions(); @@ -977,7 +977,7 @@ void KMainWidget::slotOpenTransfer() KURL url = KURL::fromPathOrURL(newtransfer); if (!url.isValid()) { - KMessageBox::error(this, i18n("Malformed URL:\n%1").tqarg(newtransfer), i18n("Error")); + KMessageBox::error(this, i18n("Malformed URL:\n%1").arg(newtransfer), i18n("Error")); ok = false; } } @@ -997,7 +997,7 @@ void KMainWidget::slotCheckClipboard() //sDebugIn << endl; #endif - TQString clipData = TQApplication::tqclipboard()->text( TQClipboard::Clipboard ).stripWhiteSpace(); + TQString clipData = TQApplication::clipboard()->text( TQClipboard::Clipboard ).stripWhiteSpace(); if (clipData != lastClipboard) { sDebug << "New clipboard event" << endl; @@ -1026,7 +1026,7 @@ void KMainWidget::slotPasteTransfer() TQString newtransfer; - newtransfer = TQApplication::tqclipboard()->text(); + newtransfer = TQApplication::clipboard()->text(); newtransfer = newtransfer.stripWhiteSpace(); if (!ksettings.b_expertMode) { @@ -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?").tqarg( destURL.prettyURL()), TQString(), 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(), i18n("Overwrite"), i18n("Do Not Overwrite") ) == KMessageBox::Yes) { bDestisMalformed=false; @@ -1141,7 +1141,7 @@ void KMainWidget::addTransferEx(const KURL& url, const KURL& destFile) // create a new transfer item Transfer *item = myTransferList->addTransfer(url, destURL); - KNotifyClient::event(kdock->winId(), "added", i18n("%1 has been added.").tqarg(url.prettyURL())); + KNotifyClient::event(kdock->winId(), "added", i18n("%1 has been added.").arg(url.prettyURL())); item->updateAll(); // update the remaining fields if (ksettings.b_showIndividual) @@ -1192,7 +1192,7 @@ void KMainWidget::addTransfers( const KURL::List& src, const TQString& 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?").tqarg( destURL.prettyURL()), TQString(), 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(), i18n("Overwrite"), i18n("Do Not Overwrite") ) == KMessageBox::Yes) { SafeDelete::deleteFile( destURL ); @@ -1360,7 +1360,7 @@ void KMainWidget::checkQueue() // count running transfers for (; it.current(); ++it) { - status = it.current()->gettqStatus(); + status = it.current()->getStatus(); if (status == Transfer::ST_RUNNING || status == Transfer::ST_TRYING) numRun++; } @@ -1370,7 +1370,7 @@ void KMainWidget::checkQueue() bool isQuequed; for (; it.current() && numRun < ksettings.maxSimultaneousConnections; ++it) { item = it.current(); - isRunning = (item->gettqStatus() == Transfer::ST_RUNNING) || ((item->gettqStatus() == Transfer::ST_TRYING)); + isRunning = (item->getStatus() == Transfer::ST_RUNNING) || ((item->getStatus() == Transfer::ST_TRYING)); isQuequed = (item->getMode() == Transfer::MD_TQUEUED || item->getMode() == Transfer::MD_NEW); @@ -1394,7 +1394,7 @@ void KMainWidget::checkQueue() for (; it.current(); ++it) { item = it.current(); - if (item->getMode() == Transfer::MD_NEW && item->gettqStatus() == Transfer::ST_STOPPED) + if (item->getMode() == Transfer::MD_NEW && item->getStatus() == Transfer::ST_STOPPED) { item->checkCache(); } @@ -1420,7 +1420,7 @@ void KMainWidget::slotAnimTimeout() animCounter = 0; } // update status of all items of transferList - isTransfer = myTransferList->updatetqStatus(animCounter); + isTransfer = myTransferList->updateStatus(animCounter); //if (this->isVisible()) { updateStatusBar(); @@ -1445,7 +1445,7 @@ void KMainWidget::slotTransferTimeout() for (; it.current(); ++it) { item = it.current(); - if (item->getMode() == Transfer::MD_SCHEDULED && item->getStartTime() <= TQDateTime::tqcurrentDateTime()) { + if (item->getMode() == Transfer::MD_SCHEDULED && item->getStartTime() <= TQDateTime::currentDateTime()) { item->setMode(Transfer::MD_TQUEUED); flag = true; } @@ -1455,7 +1455,7 @@ void KMainWidget::slotTransferTimeout() checkQueue(); } - if (ksettings.b_autoDisconnect && ksettings.b_timedDisconnect && ksettings.disconnectTime <= TQTime::currentTime() && ksettings.disconnectDate == TQDate::tqcurrentDate()) { + if (ksettings.b_autoDisconnect && ksettings.b_timedDisconnect && ksettings.disconnectTime <= TQTime::currentTime() && ksettings.disconnectDate == TQDate::currentDate()) { onlineDisconnect(); } @@ -1511,7 +1511,7 @@ void KMainWidget::slotStatusChanged(Transfer * item, int _operation) } else { - KNotifyClient::event(kdock->winId(), "finished", i18n("%1 successfully downloaded.").tqarg(srcurl)); + KNotifyClient::event(kdock->winId(), "finished", i18n("%1 successfully downloaded.").arg(srcurl)); } if ( item ) @@ -1593,7 +1593,7 @@ void KMainWidget::slotCopyToClipboard() if (item) { TQString url = item->getSrc().url(); - TQClipboard *cb = TQApplication::tqclipboard(); + TQClipboard *cb = TQApplication::clipboard(); cb->setText( url, TQClipboard::Selection ); cb->setText( url, TQClipboard::Clipboard); myTransferList->clearSelection(); @@ -2040,7 +2040,7 @@ void KMainWidget::slotUpdateActions() sDebug << "-->ONLINE= " << ksettings.b_offline << endl; #endif if (item == first_item && !ksettings.b_offline) { - switch (item->gettqStatus()) { + switch (item->getStatus()) { case Transfer::ST_TRYING: case Transfer::ST_RUNNING: m_paResume->setEnabled(false); @@ -2052,7 +2052,7 @@ void KMainWidget::slotUpdateActions() m_paPause->setEnabled(false); m_paRestart->setEnabled(false); #ifdef _DEBUG - sDebug << "STATUS IS stopped" << item->gettqStatus() << endl; + sDebug << "STATUS IS stopped" << item->getStatus() << endl; #endif break; case Transfer::ST_FINISHED: @@ -2064,7 +2064,7 @@ void KMainWidget::slotUpdateActions() } //end switch - } else if (item->gettqStatus() != first_item->gettqStatus()) { + } else if (item->getStatus() != first_item->getStatus()) { // disable all when all selected items don't have the same status m_paResume->setEnabled(false); m_paPause->setEnabled(false); @@ -2076,7 +2076,7 @@ void KMainWidget::slotUpdateActions() m_paDelete->setEnabled(true); m_paCopy->setEnabled(true); m_paIndividual->setEnabled(true); - if (item->gettqStatus() != Transfer::ST_FINISHED) { + if (item->getStatus() != Transfer::ST_FINISHED) { m_paQueue->setEnabled(true); m_paTimer->setEnabled(true); m_paDelay->setEnabled(true); @@ -2166,11 +2166,11 @@ void KMainWidget::updateStatusBar() } } - statusBar()->changeItem(i18n(" Transfers: %1 ").tqarg(myTransferList->childCount()), ID_TOTAL_TRANSFERS); - statusBar()->changeItem(i18n(" Files: %1 ").tqarg(totalFiles), ID_TOTAL_FILES); - statusBar()->changeItem(i18n(" Size: %1 ").tqarg(KIO::convertSize(totalSize)), ID_TOTAL_SIZE); - statusBar()->changeItem(i18n(" Time: %1 ").tqarg(KIO::convertSeconds(remTime)), ID_TOTAL_TIME); - statusBar()->changeItem(i18n(" %1/s ").tqarg(KIO::convertSize(totalSpeed)), ID_TOTAL_SPEED); + statusBar()->changeItem(i18n(" Transfers: %1 ").arg(myTransferList->childCount()), ID_TOTAL_TRANSFERS); + statusBar()->changeItem(i18n(" Files: %1 ").arg(totalFiles), ID_TOTAL_FILES); + statusBar()->changeItem(i18n(" Size: %1 ").arg(KIO::convertSize(totalSize)), ID_TOTAL_SIZE); + statusBar()->changeItem(i18n(" Time: %1 ").arg(KIO::convertSeconds(remTime)), ID_TOTAL_TIME); + statusBar()->changeItem(i18n(" %1/s ").arg(KIO::convertSize(totalSpeed)), ID_TOTAL_SPEED); //update size for each statusbar field statusBar()->setItemFixed(ID_TOTAL_TRANSFERS, -1); statusBar()->setItemFixed(ID_TOTAL_FILES, -1); @@ -2179,11 +2179,11 @@ void KMainWidget::updateStatusBar() statusBar()->setItemFixed(ID_TOTAL_SPEED, -1); if (kdock) { - tmpstr = i18n("Transfers: %1 ").tqarg(myTransferList->childCount()) + - i18n("
Files: %1 ").tqarg(totalFiles) + - i18n("
Size: %1 ").tqarg(KIO::convertSize(totalSize)) + - i18n("
Time: %1 ").tqarg(KIO::convertSeconds(remTime)) + - i18n("
Speed: %1/s").tqarg(KIO::convertSize(totalSpeed)); + tmpstr = i18n("Transfers: %1 ").arg(myTransferList->childCount()) + + i18n("
Files: %1 ").arg(totalFiles) + + i18n("
Size: %1 ").arg(KIO::convertSize(totalSize)) + + i18n("
Time: %1 ").arg(KIO::convertSeconds(remTime)) + + i18n("
Speed: %1/s").arg(KIO::convertSize(totalSpeed)); kdock->updateToolTip( tmpstr ); //trayicon changes if download is in progress if (totalSpeed == 0) @@ -2461,7 +2461,7 @@ bool KMainWidget::sanityChecksSuccessful( const KURL& url ) if (!url.isValid() || !KProtocolInfo::supportsReading( url ) ) { if (!ksettings.b_expertMode) - KMessageBox::error(this, i18n("Malformed URL:\n%1").tqarg(url.prettyURL()), i18n("Error")); + KMessageBox::error(this, i18n("Malformed URL:\n%1").arg(url.prettyURL()), i18n("Error")); return false; } @@ -2469,11 +2469,11 @@ bool KMainWidget::sanityChecksSuccessful( const KURL& url ) Transfer *transfer = myTransferList->find( url ); if ( transfer ) { - if ( transfer->gettqStatus() != Transfer::ST_FINISHED ) + if ( transfer->getStatus() != Transfer::ST_FINISHED ) { if ( !ksettings.b_expertMode ) { - KMessageBox::error(this, i18n("Already saving URL\n%1").tqarg(url.prettyURL()), i18n("Error")); + KMessageBox::error(this, i18n("Already saving URL\n%1").arg(url.prettyURL()), i18n("Error")); } transfer->showIndividual(); @@ -2483,7 +2483,7 @@ bool KMainWidget::sanityChecksSuccessful( const KURL& url ) else // transfer is finished, ask if we want to download again { if ( ksettings.b_expertMode || - (KMessageBox::questionYesNo(this, i18n("Already saved URL\n%1\nDownload again?").tqarg(url.prettyURL()),i18n("Question"),i18n("Download Again"),KStdGuiItem::cancel() ) + (KMessageBox::questionYesNo(this, i18n("Already saved URL\n%1\nDownload again?").arg(url.prettyURL()),i18n("Question"),i18n("Download Again"),KStdGuiItem::cancel() ) == KMessageBox::Yes) ) { transfer->slotRequestRemove(); @@ -2498,7 +2498,7 @@ bool KMainWidget::sanityChecksSuccessful( const KURL& url ) // why restrict this to ftp and http? (pfeiffer) // // don't download file URL's TODO : uncomment? // if (url.protocol() == "http" && url.protocol() != "ftp") { -// KMessageBox::error(this, i18n("File protocol not accepted!\n%1").tqarg(url.prettyURL()), i18n("Error")); +// KMessageBox::error(this, i18n("File protocol not accepted!\n%1").arg(url.prettyURL()), i18n("Error")); // #ifdef _DEBUG // sDebugOut << endl; // #endif -- cgit v1.2.1