diff options
Diffstat (limited to 'tdeioslave/trash')
| -rw-r--r-- | tdeioslave/trash/discspaceutil.cpp | 21 | ||||
| -rw-r--r-- | tdeioslave/trash/kcmtrash.cpp | 4 | ||||
| -rw-r--r-- | tdeioslave/trash/ktrashpropsdlgplugin.cpp | 6 | ||||
| -rw-r--r-- | tdeioslave/trash/ktrashpropswidget.cpp | 20 | ||||
| -rw-r--r-- | tdeioslave/trash/tdefile-plugin/RETURNED_ITEMS | 2 | ||||
| -rw-r--r-- | tdeioslave/trash/tdeio_trash.cpp | 18 | ||||
| -rw-r--r-- | tdeioslave/trash/testtrash.cpp | 20 | ||||
| -rw-r--r-- | tdeioslave/trash/testtrash.h | 2 | ||||
| -rw-r--r-- | tdeioslave/trash/trashimpl.cpp | 26 | ||||
| -rw-r--r-- | tdeioslave/trash/trashimpl.h | 4 |
10 files changed, 65 insertions, 58 deletions
diff --git a/tdeioslave/trash/discspaceutil.cpp b/tdeioslave/trash/discspaceutil.cpp index 186cb0e7f..bca944e39 100644 --- a/tdeioslave/trash/discspaceutil.cpp +++ b/tdeioslave/trash/discspaceutil.cpp @@ -52,10 +52,17 @@ unsigned long DiscSpaceUtil::sizeOfPath( const TQString &path ) TQFileInfoListIterator it( *infos ); unsigned long sum = 0; - TQFileInfo *info = 0; - while ( (info = it.current()) != 0 ) { - if ( info->fileName() != "." && info->fileName() != ".." ) - sum += sizeOfPath( info->absFilePath() ); + const TQFileInfo *info = nullptr; + while ((info = it.current())) + { + if (info->isFile()) + { + sum += info->size(); + } + else if (info->fileName() != "." && info->fileName() != "..") + { + sum += sizeOfPath(info->absFilePath()); + } ++it; } @@ -102,9 +109,9 @@ void DiscSpaceUtil::done() void DiscSpaceUtil::calculateFullSize() { KDiskFreeSp *sp = KDiskFreeSp::findUsageInfo( mDirectory ); - connect( sp, TQT_SIGNAL( foundMountPoint( const TQString&, unsigned long, unsigned long, unsigned long ) ), - this, TQT_SLOT( foundMountPoint( const TQString&, unsigned long, unsigned long, unsigned long ) ) ); - connect( sp, TQT_SIGNAL( done() ), this, TQT_SLOT( done() ) ); + connect( sp, TQ_SIGNAL( foundMountPoint( const TQString&, unsigned long, unsigned long, unsigned long ) ), + this, TQ_SLOT( foundMountPoint( const TQString&, unsigned long, unsigned long, unsigned long ) ) ); + connect( sp, TQ_SIGNAL( done() ), this, TQ_SLOT( done() ) ); tqApp->eventLoop()->enterLoop(); } diff --git a/tdeioslave/trash/kcmtrash.cpp b/tdeioslave/trash/kcmtrash.cpp index 4747e092a..06c458593 100644 --- a/tdeioslave/trash/kcmtrash.cpp +++ b/tdeioslave/trash/kcmtrash.cpp @@ -29,7 +29,7 @@ extern "C" { - KDE_EXPORT TDECModule *create_trash(TQWidget *parent, const char *) + TDE_EXPORT TDECModule *create_trash(TQWidget *parent, const char *) { return new TrashModule(parent, "kcmtrash"); } @@ -51,7 +51,7 @@ TrashModule::TrashModule(TQWidget *parent, const char *name) policyWidget = new KTrashPropsWidget(this); tab->addTab(policyWidget, i18n("&Trash Policy")); - connect(policyWidget, TQT_SIGNAL(changed(bool)), TQT_SIGNAL(changed(bool))); + connect(policyWidget, TQ_SIGNAL(changed(bool)), TQ_SIGNAL(changed(bool))); TQVBoxLayout *top = new TQVBoxLayout(this); top->addWidget(tab); diff --git a/tdeioslave/trash/ktrashpropsdlgplugin.cpp b/tdeioslave/trash/ktrashpropsdlgplugin.cpp index 067c10b6e..76882f956 100644 --- a/tdeioslave/trash/ktrashpropsdlgplugin.cpp +++ b/tdeioslave/trash/ktrashpropsdlgplugin.cpp @@ -35,7 +35,7 @@ #include <tqradiobutton.h> #include <tqspinbox.h> -#include <kdesktopfile.h> +#include <tdedesktopfile.h> #include <kgenericfactory.h> #include <tdeglobal.h> #include <kiconloader.h> @@ -63,7 +63,7 @@ KTrashPropsDlgPlugin::KTrashPropsDlgPlugin( KPropertiesDialog *dialog, const cha if (!KPropsDlgPlugin::isDesktopFile(item)) return; - KDesktopFile deskFile( itemUrl.path(), true /* readonly */ ); + TDEDesktopFile deskFile( itemUrl.path(), true /* readonly */ ); if ( deskFile.readURL() != "trash:/" ) return; } @@ -74,7 +74,7 @@ KTrashPropsDlgPlugin::KTrashPropsDlgPlugin( KPropertiesDialog *dialog, const cha policyWidget = new KTrashPropsWidget(frame); TQVBoxLayout *vLayout = new TQVBoxLayout(frame, 0, 0); vLayout->addWidget(policyWidget); - connect(policyWidget, TQT_SIGNAL(changed(bool)), TQT_SLOT(setDirty())); + connect(policyWidget, TQ_SIGNAL(changed(bool)), TQ_SLOT(setDirty())); } KTrashPropsDlgPlugin::~KTrashPropsDlgPlugin() diff --git a/tdeioslave/trash/ktrashpropswidget.cpp b/tdeioslave/trash/ktrashpropswidget.cpp index 40e12cb4f..2040e9a76 100644 --- a/tdeioslave/trash/ktrashpropswidget.cpp +++ b/tdeioslave/trash/ktrashpropswidget.cpp @@ -50,15 +50,15 @@ KTrashPropsWidget::KTrashPropsWidget(TQWidget *parent, const char *name) mTrashImpl->init(); setupGui(); - connect(mUseTimeLimit, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(useTypeChanged())); - connect(mDays, TQT_SIGNAL(valueChanged(int)),this, TQT_SLOT(setDirty())); - connect(mUseSizeLimit, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(useTypeChanged())); - connect(mPercentSize, TQT_SIGNAL(valueChanged(double)), this, TQT_SLOT(percentSizeChanged(double))); - connect(mFixedSize, TQT_SIGNAL(valueChanged(double)), this, TQT_SLOT(fixedSizeChanged(double))); - connect(mFixedSizeUnit, TQT_SIGNAL(activated(int)), this, TQT_SLOT(fixedSizeUnitActivated(int))); - connect(mRbPercentSize, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(rbPercentSizeToggled(bool))); - connect(mRbFixedSize, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(rbFixedSizeToggled(bool))); - connect(mLimitReachedAction, TQT_SIGNAL(activated(int)), this, TQT_SLOT(setDirty())); + connect(mUseTimeLimit, TQ_SIGNAL(toggled(bool)), this, TQ_SLOT(useTypeChanged())); + connect(mDays, TQ_SIGNAL(valueChanged(int)),this, TQ_SLOT(setDirty())); + connect(mUseSizeLimit, TQ_SIGNAL(toggled(bool)), this, TQ_SLOT(useTypeChanged())); + connect(mPercentSize, TQ_SIGNAL(valueChanged(double)), this, TQ_SLOT(percentSizeChanged(double))); + connect(mFixedSize, TQ_SIGNAL(valueChanged(double)), this, TQ_SLOT(fixedSizeChanged(double))); + connect(mFixedSizeUnit, TQ_SIGNAL(activated(int)), this, TQ_SLOT(fixedSizeUnitActivated(int))); + connect(mRbPercentSize, TQ_SIGNAL(toggled(bool)), this, TQ_SLOT(rbPercentSizeToggled(bool))); + connect(mRbFixedSize, TQ_SIGNAL(toggled(bool)), this, TQ_SLOT(rbFixedSizeToggled(bool))); + connect(mLimitReachedAction, TQ_SIGNAL(activated(int)), this, TQ_SLOT(setDirty())); inhibitChangedSignal = true; load(); @@ -87,7 +87,7 @@ void KTrashPropsWidget::setupGui() mountPoints->insertItem(folderPixmap, util.mountPoint(), it.key()); } mountPoints->setCurrentItem(0); - connect(mountPoints, TQT_SIGNAL(highlighted(int)), TQT_SLOT(trashChanged(int))); + connect(mountPoints, TQ_SIGNAL(highlighted(int)), TQ_SLOT(trashChanged(int))); } mCurrentTrash = map[0]; diff --git a/tdeioslave/trash/tdefile-plugin/RETURNED_ITEMS b/tdeioslave/trash/tdefile-plugin/RETURNED_ITEMS index f4e10f262..7ada25041 100644 --- a/tdeioslave/trash/tdefile-plugin/RETURNED_ITEMS +++ b/tdeioslave/trash/tdefile-plugin/RETURNED_ITEMS @@ -1,4 +1,4 @@ tdefile_trash =========== -QString OriginalPath +TQString OriginalPath DateTime DateOfDeletion diff --git a/tdeioslave/trash/tdeio_trash.cpp b/tdeioslave/trash/tdeio_trash.cpp index 90431afd5..5fc21a350 100644 --- a/tdeioslave/trash/tdeio_trash.cpp +++ b/tdeioslave/trash/tdeio_trash.cpp @@ -26,7 +26,7 @@ #include <klargefile.h> #include <tdecmdlineargs.h> #include <kmimetype.h> -#include <kprocess.h> +#include <tdeprocess.h> #include <dcopclient.h> #include <tqdatastream.h> @@ -50,7 +50,7 @@ static const TDECmdLineOptions options[] = }; extern "C" { - int KDE_EXPORT kdemain( int argc, char **argv ) + int TDE_EXPORT kdemain( int argc, char **argv ) { //TDEInstance instance( "tdeio_trash" ); // TDEApplication is necessary to use tdeio_file @@ -435,7 +435,7 @@ bool TrashProtocol::createUDSEntry( const TQString& physicalPath, const TQString addAtom( entry, TDEIO::UDS_MODIFICATION_TIME, buff.st_mtime ); addAtom( entry, TDEIO::UDS_ACCESS_TIME, buff.st_atime ); // ## or use it for deletion time? addAtom( entry, TDEIO::UDS_EXTRA, 0, info.origPath ); - addAtom( entry, TDEIO::UDS_EXTRA, 0, info.deletionDate.toString( Qt::ISODate ) ); + addAtom( entry, TDEIO::UDS_EXTRA, 0, info.deletionDate.toString( TQt::ISODate ) ); return true; } @@ -533,12 +533,12 @@ void TrashProtocol::get( const KURL& url ) KURL fileURL; fileURL.setPath( physicalPath ); TDEIO::Job* job = TDEIO::get( fileURL ); - connect( job, TQT_SIGNAL( data( TDEIO::Job*, const TQByteArray& ) ), - this, TQT_SLOT( slotData( TDEIO::Job*, const TQByteArray& ) ) ); - connect( job, TQT_SIGNAL( mimetype( TDEIO::Job*, const TQString& ) ), - this, TQT_SLOT( slotMimetype( TDEIO::Job*, const TQString& ) ) ); - connect( job, TQT_SIGNAL( result(TDEIO::Job *) ), - this, TQT_SLOT( jobFinished(TDEIO::Job *) ) ); + connect( job, TQ_SIGNAL( data( TDEIO::Job*, const TQByteArray& ) ), + this, TQ_SLOT( slotData( TDEIO::Job*, const TQByteArray& ) ) ); + connect( job, TQ_SIGNAL( mimetype( TDEIO::Job*, const TQString& ) ), + this, TQ_SLOT( slotMimetype( TDEIO::Job*, const TQString& ) ) ); + connect( job, TQ_SIGNAL( result(TDEIO::Job *) ), + this, TQ_SLOT( jobFinished(TDEIO::Job *) ) ); tqApp->eventLoop()->enterLoop(); } diff --git a/tdeioslave/trash/testtrash.cpp b/tdeioslave/trash/testtrash.cpp index 60fe2d1a6..84c0106d8 100644 --- a/tdeioslave/trash/testtrash.cpp +++ b/tdeioslave/trash/testtrash.cpp @@ -41,7 +41,7 @@ #include <unistd.h> #include <assert.h> #include <tdefileitem.h> -#include <kstandarddirs.h> +#include <tdestandarddirs.h> static bool check(const TQString& txt, TQString a, TQString b) { @@ -372,7 +372,7 @@ static void checkInfoFile( const TQString& infoPath, const TQString& origFilePat TQFileInfo info( infoPath ); assert( info.exists() ); assert( info.isFile() ); - KSimpleConfig infoFile( info.absFilePath(), true ); + TDESimpleConfig infoFile( info.absFilePath(), true ); if ( !infoFile.hasGroup( "Trash Info" ) ) kdFatal() << "no Trash Info group in " << info.absFilePath() << endl; infoFile.setGroup( "Trash Info" ); @@ -476,7 +476,7 @@ void TestTrash::trashUmlautFileFromHome() void TestTrash::testTrashNotEmpty() { - KSimpleConfig cfg( "trashrc", true ); + TDESimpleConfig cfg( "trashrc", true ); assert( cfg.hasGroup( "Status" ) ); cfg.setGroup( "Status" ); assert( cfg.readBoolEntry( "Empty", true ) == false ); @@ -1094,8 +1094,8 @@ void TestTrash::listRootDir() m_entryCount = 0; m_listResult.clear(); TDEIO::ListJob* job = TDEIO::listDir( "trash:/" ); - connect( job, TQT_SIGNAL( entries( TDEIO::Job*, const TDEIO::UDSEntryList& ) ), - TQT_SLOT( slotEntries( TDEIO::Job*, const TDEIO::UDSEntryList& ) ) ); + connect( job, TQ_SIGNAL( entries( TDEIO::Job*, const TDEIO::UDSEntryList& ) ), + TQ_SLOT( slotEntries( TDEIO::Job*, const TDEIO::UDSEntryList& ) ) ); bool ok = TDEIO::NetAccess::synchronousRun( job, 0 ); assert( ok ); kdDebug() << "listDir done - m_entryCount=" << m_entryCount << endl; @@ -1111,8 +1111,8 @@ void TestTrash::listRecursiveRootDir() m_entryCount = 0; m_listResult.clear(); TDEIO::ListJob* job = TDEIO::listRecursive( "trash:/" ); - connect( job, TQT_SIGNAL( entries( TDEIO::Job*, const TDEIO::UDSEntryList& ) ), - TQT_SLOT( slotEntries( TDEIO::Job*, const TDEIO::UDSEntryList& ) ) ); + connect( job, TQ_SIGNAL( entries( TDEIO::Job*, const TDEIO::UDSEntryList& ) ), + TQ_SLOT( slotEntries( TDEIO::Job*, const TDEIO::UDSEntryList& ) ) ); bool ok = TDEIO::NetAccess::synchronousRun( job, 0 ); assert( ok ); kdDebug() << "listDir done - m_entryCount=" << m_entryCount << endl; @@ -1128,8 +1128,8 @@ void TestTrash::listSubDir() m_entryCount = 0; m_listResult.clear(); TDEIO::ListJob* job = TDEIO::listDir( "trash:/0-trashDirFromHome" ); - connect( job, TQT_SIGNAL( entries( TDEIO::Job*, const TDEIO::UDSEntryList& ) ), - TQT_SLOT( slotEntries( TDEIO::Job*, const TDEIO::UDSEntryList& ) ) ); + connect( job, TQ_SIGNAL( entries( TDEIO::Job*, const TDEIO::UDSEntryList& ) ), + TQ_SLOT( slotEntries( TDEIO::Job*, const TDEIO::UDSEntryList& ) ) ); bool ok = TDEIO::NetAccess::synchronousRun( job, 0 ); assert( ok ); kdDebug() << "listDir done - m_entryCount=" << m_entryCount << endl; @@ -1179,7 +1179,7 @@ void TestTrash::emptyTrash() bool ok = TDEIO::NetAccess::synchronousRun( job, 0 ); assert( ok ); - KSimpleConfig cfg( "trashrc", true ); + TDESimpleConfig cfg( "trashrc", true ); assert( cfg.hasGroup( "Status" ) ); cfg.setGroup( "Status" ); assert( cfg.readBoolEntry( "Empty", false ) == true ); diff --git a/tdeioslave/trash/testtrash.h b/tdeioslave/trash/testtrash.h index a7e093b48..1b46e3551 100644 --- a/tdeioslave/trash/testtrash.h +++ b/tdeioslave/trash/testtrash.h @@ -22,7 +22,7 @@ #include <tqobject.h> -class TestTrash : public QObject +class TestTrash : public TQObject { TQ_OBJECT diff --git a/tdeioslave/trash/trashimpl.cpp b/tdeioslave/trash/trashimpl.cpp index 4f7dbf492..19078539c 100644 --- a/tdeioslave/trash/trashimpl.cpp +++ b/tdeioslave/trash/trashimpl.cpp @@ -29,7 +29,7 @@ #include <kurl.h> #include <kdirnotify_stub.h> #include <tdeglobal.h> -#include <kstandarddirs.h> +#include <tdestandarddirs.h> #include <tdeglobalsettings.h> #include <kmountpoint.h> #include <tdemessagebox.h> @@ -251,7 +251,7 @@ bool TrashImpl::createInfo( const TQString& origPath, int& trashId, TQString& fi return false; } - // Contents of the info file. We could use KSimpleConfig, but that would + // Contents of the info file. We could use TDESimpleConfig, but that would // mean closing and reopening fd, i.e. opening a race condition... TQCString info = "[Trash Info]\n"; info += "Path="; @@ -263,7 +263,7 @@ bool TrashImpl::createInfo( const TQString& origPath, int& trashId, TQString& fi info += KURL::encode_string( makeRelativePath( topDirectoryPath( trashId ), origPath ), m_mibEnum ).latin1(); info += "\n"; info += "DeletionDate="; - info += TQDateTime::currentDateTime().toString( Qt::ISODate ).latin1(); + info += TQDateTime::currentDateTime().toString( TQt::ISODate ).latin1(); info += "\n"; size_t sz = info.size() - 1; // avoid trailing 0 from QCString @@ -374,8 +374,8 @@ bool TrashImpl::move( const TQString& src, const TQString& dest ) #ifdef TDEIO_COPYJOB_HAS_SETINTERACTIVE job->setInteractive( false ); #endif - connect( job, TQT_SIGNAL( result(TDEIO::Job *) ), - this, TQT_SLOT( jobFinished(TDEIO::Job *) ) ); + connect( job, TQ_SIGNAL( result(TDEIO::Job *) ), + this, TQ_SLOT( jobFinished(TDEIO::Job *) ) ); tqApp->eventLoop()->enterLoop(); return m_lastErrorCode == 0; @@ -424,8 +424,8 @@ bool TrashImpl::copy( const TQString& src, const TQString& dest ) #ifdef TDEIO_COPYJOB_HAS_SETINTERACTIVE job->setInteractive( false ); #endif - connect( job, TQT_SIGNAL( result( TDEIO::Job* ) ), - this, TQT_SLOT( jobFinished( TDEIO::Job* ) ) ); + connect( job, TQ_SIGNAL( result( TDEIO::Job* ) ), + this, TQ_SLOT( jobFinished( TDEIO::Job* ) ) ); tqApp->eventLoop()->enterLoop(); return m_lastErrorCode == 0; @@ -513,15 +513,15 @@ bool TrashImpl::synchronousDel( const TQString& path, bool setLastErrorCode, boo KFileItemList fileItemList; fileItemList.append( &fileItem ); TDEIO::ChmodJob* chmodJob = TDEIO::chmod( fileItemList, 0200, 0200, TQString::null, TQString::null, true /*recursive*/, false /*showProgressInfo*/ ); - connect( chmodJob, TQT_SIGNAL( result(TDEIO::Job *) ), - this, TQT_SLOT( jobFinished(TDEIO::Job *) ) ); + connect( chmodJob, TQ_SIGNAL( result(TDEIO::Job *) ), + this, TQ_SLOT( jobFinished(TDEIO::Job *) ) ); tqApp->eventLoop()->enterLoop(); } kdDebug() << k_funcinfo << "deleting " << url << endl; TDEIO::DeleteJob *job = TDEIO::del( url, false, false ); - connect( job, TQT_SIGNAL( result(TDEIO::Job *) ), - this, TQT_SLOT( jobFinished(TDEIO::Job *) ) ); + connect( job, TQ_SIGNAL( result(TDEIO::Job *) ), + this, TQ_SLOT( jobFinished(TDEIO::Job *) ) ); tqApp->eventLoop()->enterLoop(); bool ok = m_lastErrorCode == 0; if ( !setLastErrorCode ) { @@ -620,7 +620,7 @@ bool TrashImpl::infoForFile( int trashId, const TQString& fileId, TrashedFileInf bool TrashImpl::readInfoFile( const TQString& infoPath, TrashedFileInfo& info, int trashId ) { - KSimpleConfig cfg( infoPath, true ); + TDESimpleConfig cfg( infoPath, true ); if ( !cfg.hasGroup( "Trash Info" ) ) { error( TDEIO::ERR_CANNOT_OPEN_FOR_READING, infoPath ); return false; @@ -637,7 +637,7 @@ bool TrashImpl::readInfoFile( const TQString& infoPath, TrashedFileInfo& info, i } TQString line = cfg.readEntry( "DeletionDate" ); if ( !line.isEmpty() ) { - info.deletionDate = TQDateTime::fromString( line, Qt::ISODate ); + info.deletionDate = TQDateTime::fromString( line, TQt::ISODate ); } return true; } diff --git a/tdeioslave/trash/trashimpl.h b/tdeioslave/trash/trashimpl.h index 90032762d..6d96859f7 100644 --- a/tdeioslave/trash/trashimpl.h +++ b/tdeioslave/trash/trashimpl.h @@ -21,7 +21,7 @@ #define TRASHIMPL_H #include <tdeio/jobclasses.h> -#include <ksimpleconfig.h> +#include <tdesimpleconfig.h> #include <tqstring.h> #include <tqdatetime.h> @@ -172,7 +172,7 @@ private: mutable bool m_trashDirectoriesScanned; int m_mibEnum; - KSimpleConfig m_config; + TDESimpleConfig m_config; // We don't cache any data related to the trashed files. // Another tdeioslave could change that behind our feet. |
