Preparing terrain for kio_uiserver

Rafael Fernández López ereslibre at gmail.com
Fri Dec 22 15:56:43 GMT 2006


Hi guys,

This is the patch taking in count all suggestions made here.

If no objections it should be committed on tuesday.

Thanks,
Rafael Fernández López.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20061222/949b7ba3/attachment.htm>
-------------- next part --------------
Index: kio/kio/jobuidelegate.h
===================================================================
--- kio/kio/jobuidelegate.h	(revisi��n: 615756)
+++ kio/kio/jobuidelegate.h	(copia de trabajo)
@@ -81,6 +81,36 @@ public:
 
     virtual void showErrorMessage();
 
+    /**
+      * Set the icon that will be showed to @p jobIcon.
+      * @param jobIcon the icon associated with this job
+      * @see jobIcon()
+      */
+    void setJobIcon(const QString &jobIcon);
+
+    /**
+      * Returns the icon to be showed on the kio_uiserver when
+      * drawing this job
+      * If not set, this will return the default app icon
+      * that launched this job
+      * @return the icon associated to this job
+      * @see setJobIcon()
+      */
+    QString jobIcon() const;
+
+    /**
+      * Returns the app friendly name that launched this job
+      * @return the app friendly name that launched this job
+      * @see setAppName()
+      */
+    QString appName() const;
+
+    /**
+      * Returns the app internal name that launched this job
+      * @return the app internal name that launched this job
+      */
+    QString internalAppName() const;
+
 protected:
      virtual void connectJob( KJob *job );
 
Index: kio/kio/jobuidelegate.cpp
===================================================================
--- kio/kio/jobuidelegate.cpp	(revisi��n: 615756)
+++ kio/kio/jobuidelegate.cpp	(copia de trabajo)
@@ -24,6 +24,9 @@
 #include <qpointer.h>
 #include <kmessagebox.h>
 #include <kjob.h>
+#include <kglobal.h>
+#include <kinstance.h>
+#include <kaboutdata.h>
 #include "kio/observer.h"
 #include "kio/scheduler.h"
 
@@ -38,6 +41,9 @@ public:
     bool showProgressInfo;
     QPointer<QWidget> errorParentWidget;
     unsigned long userTimestamp;
+    QString jobIcon;
+    QString appName;
+    QString internalAppName;
 };
 
 KIO::JobUiDelegate::JobUiDelegate( bool showProgressInfo )
@@ -48,6 +54,9 @@ KIO::JobUiDelegate::JobUiDelegate( bool 
 #if defined Q_WS_X11
     d->userTimestamp = QX11Info::appUserTime();
 #endif
+    d->jobIcon = KGlobal::instance()->aboutData()->appName();
+    d->appName = KGlobal::instance()->aboutData()->programName();
+    d->internalAppName = d->jobIcon;
 }
 
 KIO::JobUiDelegate::~JobUiDelegate()
@@ -123,6 +132,26 @@ void KIO::JobUiDelegate::showErrorMessag
     }
 }
 
+void KIO::JobUiDelegate::setJobIcon(const QString &jobIcon)
+{
+    d->jobIcon = jobIcon;
+}
+
+QString KIO::JobUiDelegate::jobIcon() const
+{
+    return d->jobIcon;
+}
+
+QString KIO::JobUiDelegate::appName() const
+{
+    return d->appName;
+}
+
+QString KIO::JobUiDelegate::internalAppName() const
+{
+    return d->internalAppName;
+}
+
 void KIO::JobUiDelegate::slotFinished( KJob * /*job*/, int /*id*/ )
 {
     // If we are displaying a progress dialog, remove it first.


More information about the kde-core-devel mailing list