Alessandro Diaferia 写道:


2009/9/1 "潘卫平(Peter Pan)" <wp...@redflag-linux.com <mailto:wp...@redflag-linux.com>>

    Hi, all

    The plasma trash applet doesn't emit a KNotification when the trash is
    emptied, so there is no sound.


    Regards

    --
    潘卫平(Peter Pan)
    Red Flag Software Co., Ltd

    _______________________________________________
    Plasma-devel mailing list
    Plasma-devel@kde.org <mailto:Plasma-devel@kde.org>
    https://mail.kde.org/mailman/listinfo/plasma-devel



+1 for committing this patch from my side

Just one little side note: is it really needed to do emptyTrash->setEnabled(false); again in the emptyFinished slot?

--
Alessandro Diaferia
KDE Developer


------------------------------------------------------------------------

_______________________________________________
Plasma-devel mailing list
Plasma-devel@kde.org
https://mail.kde.org/mailman/listinfo/plasma-devel
yes, no need.
I think emptyTrash->setEnabled() and emptyTrash->setText() are not necessary.
The modified patch is followed.

Regards
--
潘卫平(Peter Pan)
Red Flag Software Co., Ltd
Index: trash.cpp
===================================================================
--- trash.cpp	(revision 1018141)
+++ trash.cpp	(working copy)
@@ -35,6 +35,7 @@
 #include <KUrl>
 #include <KProcess>
 #include <KStandardDirs>
+#include <KNotification>
 
 #include <kfileplacesmodel.h>
 
@@ -213,7 +214,6 @@
         // we can simply call ktrash.
         //KonqOperations::emptyTrash(&m_menu);
         emptyTrash->setEnabled(false);
-        emptyTrash->setText(i18n("Emptying Trashcan..."));
         m_emptyProcess = new KProcess(this);
         connect(m_emptyProcess, SIGNAL(finished(int,QProcess::ExitStatus)),
                 this, SLOT(emptyFinished(int,QProcess::ExitStatus)));
@@ -226,11 +226,12 @@
 {
     Q_UNUSED(exitCode)
     Q_UNUSED(exitStatus)
+
+    KNotification::event("Trash: emptied", QString() , QPixmap() , 0l, KNotification::DefaultEvent );
+    
     //TODO: check the exit status and let the user know if it fails
     delete m_emptyProcess;
     m_emptyProcess = 0;
-    emptyTrash->setEnabled(true);
-    emptyTrash->setText(i18n("&Empty Trashcan"));
 }
 
 void Trash::updateIcon()
_______________________________________________
Plasma-devel mailing list
Plasma-devel@kde.org
https://mail.kde.org/mailman/listinfo/plasma-devel

Reply via email to