summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichele Calgaro <michele.calgaro@yahoo.it>2016-10-12 16:27:27 +0900
committerMichele Calgaro <michele.calgaro@yahoo.it>2016-10-12 16:27:27 +0900
commit6110a523f9acb34a704fda02b2aa9d5e555358f5 (patch)
treef77c27a7faca8a5ac98fee2db43760c58985dfdc
parentee3091bc41f5cae8be2ba5f8335e0b866edb4711 (diff)
downloadtdebase-6110a523.tar.gz
tdebase-6110a523.zip
Trash limit: clean up previous patch (KDE -> TDE conversion, debug messages, TQt
signals/slots...). Improved error message when a file is too big to fit within the max trash size limit. This relates to bug 1923. Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
-rw-r--r--tdeioslave/trash/discspaceutil.cpp8
-rw-r--r--tdeioslave/trash/discspaceutil.h2
-rw-r--r--tdeioslave/trash/ktrash.cpp2
-rw-r--r--tdeioslave/trash/ktrashpropsdlgplugin.cpp46
-rw-r--r--tdeioslave/trash/ktrashpropsdlgplugin.desktop1
-rw-r--r--tdeioslave/trash/ktrashpropsdlgplugin.h2
-rw-r--r--tdeioslave/trash/tdefile-plugin/tdefile_trash.cpp2
-rw-r--r--tdeioslave/trash/tdefile-plugin/tdefile_trash.h2
-rw-r--r--tdeioslave/trash/tdeio_trash.cpp2
-rw-r--r--tdeioslave/trash/tdeio_trash.h2
-rw-r--r--tdeioslave/trash/testtrash.cpp4
-rw-r--r--tdeioslave/trash/testtrash.h2
-rw-r--r--tdeioslave/trash/trashimpl.cpp4
-rw-r--r--tdeioslave/trash/trashimpl.h2
14 files changed, 36 insertions, 45 deletions
diff --git a/tdeioslave/trash/discspaceutil.cpp b/tdeioslave/trash/discspaceutil.cpp
index a771638fc..186cb0e7f 100644
--- a/tdeioslave/trash/discspaceutil.cpp
+++ b/tdeioslave/trash/discspaceutil.cpp
@@ -1,5 +1,5 @@
/*
- This file is part of the KDE project
+ This file is part of the TDE project
Copyright (C) 2008 Tobias Koenig <tokoe@kde.org>
@@ -102,9 +102,9 @@ void DiscSpaceUtil::done()
void DiscSpaceUtil::calculateFullSize()
{
KDiskFreeSp *sp = KDiskFreeSp::findUsageInfo( mDirectory );
- connect( sp, SIGNAL( foundMountPoint( const TQString&, unsigned long, unsigned long, unsigned long ) ),
- this, SLOT( foundMountPoint( const TQString&, unsigned long, unsigned long, unsigned long ) ) );
- connect( sp, SIGNAL( done() ), this, SLOT( done() ) );
+ 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() ) );
tqApp->eventLoop()->enterLoop();
}
diff --git a/tdeioslave/trash/discspaceutil.h b/tdeioslave/trash/discspaceutil.h
index a43b7b2cd..a00141296 100644
--- a/tdeioslave/trash/discspaceutil.h
+++ b/tdeioslave/trash/discspaceutil.h
@@ -1,5 +1,5 @@
/*
- This file is part of the KDE project
+ This file is part of the TDE project
Copyright (C) 2008 Tobias Koenig <tokoe@kde.org>
diff --git a/tdeioslave/trash/ktrash.cpp b/tdeioslave/trash/ktrash.cpp
index 162d27876..4450156f8 100644
--- a/tdeioslave/trash/ktrash.cpp
+++ b/tdeioslave/trash/ktrash.cpp
@@ -1,4 +1,4 @@
-/* This file is part of the KDE project
+/* This file is part of the TDE project
Copyright (C) 2004 David Faure <faure@kde.org>
This library is free software; you can redistribute it and/or
diff --git a/tdeioslave/trash/ktrashpropsdlgplugin.cpp b/tdeioslave/trash/ktrashpropsdlgplugin.cpp
index 9d18f2acf..157790c5f 100644
--- a/tdeioslave/trash/ktrashpropsdlgplugin.cpp
+++ b/tdeioslave/trash/ktrashpropsdlgplugin.cpp
@@ -1,5 +1,5 @@
/*
- This file is part of the KDE project
+ This file is part of the TDE project
Copyright (C) 2008 Tobias Koenig <tokoe@kde.org>
Copyright (C) 2016 Emanoil Kotsev <deloptes@yahoo.com>
@@ -46,7 +46,6 @@ K_EXPORT_COMPONENT_FACTORY( ktrashpropsdlgplugin, Factory( "ktrashpropsdlgplugin
KTrashPropsDlgPlugin::KTrashPropsDlgPlugin( KPropertiesDialog *dialog, const char*, const TQStringList& )
: KPropsDlgPlugin( dialog )
{
- kdDebug() << "KTrashPropsDlgPlugin::KTrashPropsDlgPlugin called" << endl;
if ( dialog->items().count() != 1 )
return;
@@ -55,13 +54,11 @@ KTrashPropsDlgPlugin::KTrashPropsDlgPlugin( KPropertiesDialog *dialog, const cha
if ( !KPropsDlgPlugin::isDesktopFile( item ) )
return;
- kdDebug() << "KPropsDlgPlugin::isDesktopFile( item ) passed" << endl;
KDesktopFile deskFile( item->url().path(), true /* readonly */ );
if ( deskFile.readURL() != "trash:/" )
return;
- kdDebug() << "deskFile.readURL() != \"trash:/\") passed" << endl;
TDEGlobal::locale()->insertCatalogue( "tdeio_trash" );
mTrashImpl = new TrashImpl();
@@ -83,22 +80,22 @@ KTrashPropsDlgPlugin::KTrashPropsDlgPlugin( KPropertiesDialog *dialog, const cha
useTypeChanged();
- connect( mUseTimeLimit, SIGNAL( toggled( bool ) ),
- this, SLOT( setDirty() ) );
- connect( mUseTimeLimit, SIGNAL( toggled( bool ) ),
- this, SLOT( useTypeChanged() ) );
- connect( mDays, SIGNAL( valueChanged( int ) ),
- this, SLOT( setDirty() ) );
- connect( mUseSizeLimit, SIGNAL( toggled( bool ) ),
- this, SLOT( setDirty() ) );
- connect( mUseSizeLimit, SIGNAL( toggled( bool ) ),
- this, SLOT( useTypeChanged() ) );
- connect( mPercent, SIGNAL( valueChanged( double ) ),
- this, SLOT( percentChanged( double ) ) );
- connect( mPercent, SIGNAL( valueChanged( double ) ),
- this, SLOT( setDirty() ) );
- connect( mLimitReachedAction, SIGNAL( activated( int ) ),
- this, SLOT( setDirty() ) );
+ connect( mUseTimeLimit, TQT_SIGNAL( toggled( bool ) ),
+ this, TQT_SLOT( setDirty() ) );
+ 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( setDirty() ) );
+ connect( mUseSizeLimit, TQT_SIGNAL( toggled( bool ) ),
+ this, TQT_SLOT( useTypeChanged() ) );
+ connect( mPercent, TQT_SIGNAL( valueChanged( double ) ),
+ this, TQT_SLOT( percentChanged( double ) ) );
+ connect( mPercent, TQT_SIGNAL( valueChanged( double ) ),
+ this, TQT_SLOT( setDirty() ) );
+ connect( mLimitReachedAction, TQT_SIGNAL( activated( int ) ),
+ this, TQT_SLOT( setDirty() ) );
trashChanged( 0 );
}
@@ -130,9 +127,7 @@ void KTrashPropsDlgPlugin::percentChanged( double percent )
double size = partitionSize*(percent/100.0);
-// Step should be depending on size
-// https://api.kde.org/3.5-api/kdelibs-apidocs/kdeui/html/classKDoubleSpinBox.html
-// https://api.kde.org/3.5-api/kdelibs-apidocs/kdeui/html/knuminput_8cpp_source.html
+ // FIXME It would be good if precision step depended on max HD size
mPercent->setPrecision(3);
TQString unit = i18n( "Byte" );
@@ -203,7 +198,6 @@ void KTrashPropsDlgPlugin::useTypeChanged()
void KTrashPropsDlgPlugin::readConfig()
{
- kdDebug() << "KTrashPropsDlgPlugin::readConfig() called" << endl;
TDEConfig config( "trashrc" );
mConfigMap.clear();
@@ -224,7 +218,6 @@ void KTrashPropsDlgPlugin::readConfig()
void KTrashPropsDlgPlugin::writeConfig()
{
- kdDebug() << "KTrashPropsDlgPlugin::writeConfig() called" << endl;
TDEConfig config( "trashrc" );
// first delete all existing groups
@@ -248,7 +241,6 @@ void KTrashPropsDlgPlugin::writeConfig()
void KTrashPropsDlgPlugin::setupGui( TQFrame *frame )
{
- kdDebug() << "KTrashPropsDlgPlugin::setupGui( TQFrame *frame )" << endl;
TQVBoxLayout *layout = new TQVBoxLayout( frame, 11, 6 );
TrashImpl::TrashDirMap map = mTrashImpl->trashDirectories();
@@ -267,7 +259,7 @@ void KTrashPropsDlgPlugin::setupGui( TQFrame *frame )
mountPoints->setCurrentItem( 0 );
- connect( mountPoints, SIGNAL( highlighted( int ) ), SLOT( trashChanged( int ) ) );
+ connect( mountPoints, TQT_SIGNAL( highlighted( int ) ), TQT_SLOT( trashChanged( int ) ) );
} else {
mCurrentTrash = map[0];
}
diff --git a/tdeioslave/trash/ktrashpropsdlgplugin.desktop b/tdeioslave/trash/ktrashpropsdlgplugin.desktop
index 91f0632b0..39782d602 100644
--- a/tdeioslave/trash/ktrashpropsdlgplugin.desktop
+++ b/tdeioslave/trash/ktrashpropsdlgplugin.desktop
@@ -2,5 +2,6 @@
Type=Service
Name=Trash Properties Page
Name[bg]=Свойства на кошчето
+Name[it]=Proprietà del cestino
X-TDE-Library=ktrashpropsdlgplugin
X-TDE-ServiceTypes=KPropsDlg/Plugin,media/builtin-trash
diff --git a/tdeioslave/trash/ktrashpropsdlgplugin.h b/tdeioslave/trash/ktrashpropsdlgplugin.h
index d47e75dd3..b62ba127d 100644
--- a/tdeioslave/trash/ktrashpropsdlgplugin.h
+++ b/tdeioslave/trash/ktrashpropsdlgplugin.h
@@ -1,5 +1,5 @@
/*
- This file is part of the KDE project
+ This file is part of the TDE project
Copyright (C) 2008 Tobias Koenig <tokoe@kde.org>
diff --git a/tdeioslave/trash/tdefile-plugin/tdefile_trash.cpp b/tdeioslave/trash/tdefile-plugin/tdefile_trash.cpp
index 983a09db2..5c903fcb8 100644
--- a/tdeioslave/trash/tdefile-plugin/tdefile_trash.cpp
+++ b/tdeioslave/trash/tdefile-plugin/tdefile_trash.cpp
@@ -1,4 +1,4 @@
-/* This file is part of the KDE project
+/* This file is part of the TDE project
* Copyright (C) 2004 David Faure <faure@kde.org>
* Based on tdefile_txt.cpp by Nadeem Hasan <nhasan@kde.org>
*
diff --git a/tdeioslave/trash/tdefile-plugin/tdefile_trash.h b/tdeioslave/trash/tdefile-plugin/tdefile_trash.h
index 71e4f2bff..fbd6c9e3d 100644
--- a/tdeioslave/trash/tdefile-plugin/tdefile_trash.h
+++ b/tdeioslave/trash/tdefile-plugin/tdefile_trash.h
@@ -1,4 +1,4 @@
-/* This file is part of the KDE project
+/* This file is part of the TDE project
* Copyright (C) 2004 David Faure <faure@kde.org>
* Based on tdefile_txt.h by Nadeem Hasan <nhasan@kde.org>
*
diff --git a/tdeioslave/trash/tdeio_trash.cpp b/tdeioslave/trash/tdeio_trash.cpp
index e8fdec8f5..90431afd5 100644
--- a/tdeioslave/trash/tdeio_trash.cpp
+++ b/tdeioslave/trash/tdeio_trash.cpp
@@ -1,4 +1,4 @@
-/* This file is part of the KDE project
+/* This file is part of the TDE project
Copyright (C) 2004 David Faure <faure@kde.org>
This library is free software; you can redistribute it and/or
diff --git a/tdeioslave/trash/tdeio_trash.h b/tdeioslave/trash/tdeio_trash.h
index 954dbe7a6..157db3464 100644
--- a/tdeioslave/trash/tdeio_trash.h
+++ b/tdeioslave/trash/tdeio_trash.h
@@ -1,4 +1,4 @@
-/* This file is part of the KDE project
+/* This file is part of the TDE project
Copyright (C) 2004 David Faure <faure@kde.org>
This library is free software; you can redistribute it and/or
diff --git a/tdeioslave/trash/testtrash.cpp b/tdeioslave/trash/testtrash.cpp
index fc5b358af..60fe2d1a6 100644
--- a/tdeioslave/trash/testtrash.cpp
+++ b/tdeioslave/trash/testtrash.cpp
@@ -1,4 +1,4 @@
-/* This file is part of the KDE project
+/* This file is part of the TDE project
Copyright (C) 2004 David Faure <faure@kde.org>
This library is free software; you can redistribute it and/or
@@ -24,8 +24,6 @@
#include "tdeio_trash.h"
#include "testtrash.h"
-// #include <config.h>
-
#include <kurl.h>
#include <tdelocale.h>
#include <tdeapplication.h>
diff --git a/tdeioslave/trash/testtrash.h b/tdeioslave/trash/testtrash.h
index ebc217aac..e87b9c3a0 100644
--- a/tdeioslave/trash/testtrash.h
+++ b/tdeioslave/trash/testtrash.h
@@ -1,4 +1,4 @@
-/* This file is part of the KDE project
+/* This file is part of the TDE project
Copyright (C) 2004 David Faure <faure@kde.org>
This library is free software; you can redistribute it and/or
diff --git a/tdeioslave/trash/trashimpl.cpp b/tdeioslave/trash/trashimpl.cpp
index 1b67e5949..e6b219a13 100644
--- a/tdeioslave/trash/trashimpl.cpp
+++ b/tdeioslave/trash/trashimpl.cpp
@@ -1,4 +1,4 @@
-/* This file is part of the KDE project
+/* This file is part of the TDE project
Copyright (C) 2004 David Faure <faure@kde.org>
This library is free software; you can redistribute it and/or
@@ -1018,7 +1018,7 @@ bool TrashImpl::adaptTrashSize( const TQString& origPath, int trashId )
if ( ((double)fileSize*100/(double)partitionSize) >= percent ) {
m_lastErrorCode = TDEIO::ERR_SLAVE_DEFINED;
- m_lastErrorMessage = i18n( "The file is too large to be trashed." );
+ m_lastErrorMessage = i18n( "The file is too big to be trashed because it exceeds the maximum size set for the trash bin." );
return false;
}
diff --git a/tdeioslave/trash/trashimpl.h b/tdeioslave/trash/trashimpl.h
index b02ae4709..812922364 100644
--- a/tdeioslave/trash/trashimpl.h
+++ b/tdeioslave/trash/trashimpl.h
@@ -1,4 +1,4 @@
-/* This file is part of the KDE project
+/* This file is part of the TDE project
Copyright (C) 2004 David Faure <faure@kde.org>
This library is free software; you can redistribute it and/or