[kde-doc-english] KDE/kdelibs/kfile

Jeffery MacEachern j.maceachern at gmail.com
Sun Nov 21 02:15:18 CET 2010


SVN commit 1199217 by jmaceachern:

Conditionally changes KFilePlaceEditDialog's title to "Add"/"Edit" to reflect the operation that is actually being performed.
BUG: 231315
GUI:


 M  +10 -3     kfileplaceeditdialog.cpp  
 M  +2 -0      kfileplaceeditdialog.h  
 M  +2 -2      kfileplacesview.cpp  


--- trunk/KDE/kdelibs/kfile/kfileplaceeditdialog.cpp #1199216:1199217
@@ -53,13 +53,16 @@
 
 bool KFilePlaceEditDialog::getInformation(bool allowGlobal, KUrl& url,
                                           QString& label, QString& icon,
+                                          bool isAddingNewPlace,
                                           bool& appLocal, int iconSize,
                                           QWidget *parent )
 {
     KFilePlaceEditDialog *dialog = new KFilePlaceEditDialog(allowGlobal, url,
                                                             label, icon,
                                                             appLocal,
-                                                            iconSize, parent );
+                                                            iconSize,
+                                                            isAddingNewPlace,
+                                                            parent );
     if ( dialog->exec() == QDialog::Accepted ) {
         // set the return parameters
         url         = dialog->url();
@@ -77,11 +80,15 @@
 
 KFilePlaceEditDialog::KFilePlaceEditDialog(bool allowGlobal, const KUrl& url,
                                            const QString& label,
-                                           const QString &icon, bool appLocal,
-                                           int iconSize,
+                                           const QString &icon,
+                                           bool isAddingNewPlace,
+                                           bool appLocal, int iconSize,
                                            QWidget *parent)
     : KDialog( parent )
 {
+    if (isAddingNewPlace)
+        setCaption( i18n("Add Places Entry") );
+    else
     setCaption( i18n("Edit Places Entry") );
     setButtons( Ok | Cancel );
     setModal(true);
--- trunk/KDE/kdelibs/kfile/kfileplaceeditdialog.h #1199216:1199217
@@ -64,6 +64,7 @@
      */
     static bool getInformation( bool allowGlobal, KUrl& url,
                                 QString& label, QString& icon,
+                                bool isAddingNewPlace,
                                 bool& appLocal, int iconSize,
                                 QWidget *parent = 0 );
 
@@ -86,6 +87,7 @@
      */
     KFilePlaceEditDialog(bool allowGlobal, const KUrl& url,
                          const QString& label, const QString &icon,
+                         bool isAddingNewPlace,
                          bool appLocal = true,
                          int iconSize = KIconLoader::SizeMedium,
                          QWidget *parent = 0);
--- trunk/KDE/kdelibs/kfile/kfileplacesview.cpp #1199216:1199217
@@ -655,7 +655,7 @@
         bool appLocal = !bookmark.metaDataItem("OnlyInApp").isEmpty();
 
         if (KFilePlaceEditDialog::getInformation(true, url, label,
-                                                 iconName, appLocal, 64, this))
+                                                 iconName, false, appLocal, 64, this))
         {
             QString appName;
             if (appLocal) appName = KGlobal::mainComponent().componentName();
@@ -689,7 +689,7 @@
         QString iconName = "folder";
         bool appLocal = true;
         if (KFilePlaceEditDialog::getInformation(true, url, label,
-                                                 iconName, appLocal, 64, this))
+                                                 iconName, true, appLocal, 64, this))
         {
             QString appName;
             if (appLocal) appName = KGlobal::mainComponent().componentName();



More information about the kde-doc-english mailing list