[Kst] [Bug 89498] If n vectors are not found, kst should only display one error dialog, not n error dialogs

Andrew Walker arwalker at sumusltd.com
Tue Sep 14 20:03:08 CEST 2004


------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
        
http://bugs.kde.org/show_bug.cgi?id=89498        
arwalker sumusltd com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |FIXED



------- Additional Comments From arwalker sumusltd com  2004-09-14 20:03 -------
CVS commit by arwalker: 

Display only a single error message for all the invalid vector sources.

CCMAIL: 89498-done bugs kde org


  M +16 -3     kstchangefiledialog_i.cpp   1.22


--- kdeextragear-2/kst/kst/kstchangefiledialog_i.cpp  #1.21:1.22
 @ -71,6 +71,7  @ void KstChangeFileDialogI::applyFileChan
   KstDataSourcePtr file;
   KstWriteLocker ml(&KST::dataSourceList.lock());
-
   KstDataSourceList::Iterator it = KST::dataSourceList.findFileName(_dataFile->url());
+  QString invalidSources;
+  int invalid = 0;
 
   if (it == KST::dataSourceList.end()) {
 @ -97,5 +98,9  @ void KstChangeFileDialogI::applyFileChan
       vector->writeLock();
       if (!file->isValidField(vector->field())) {
-        KMessageBox::sorry(this, i18n("%1: Field is not defined for the requested file.").arg(vector->field()));
+        if (invalid > 0) {
+          invalidSources += ", ";
+        }
+        invalidSources += vector->field();
+        invalid++;
       } else {
         vector->changeFile(file);
 @ -105,4 +110,12  @ void KstChangeFileDialogI::applyFileChan
   }
 
+  if (!invalidSources.isEmpty()) {
+    if (invalid == 1) {
+      KMessageBox::sorry(this, i18n("The following field is not defined for the requested file:\n%1").arg(invalidSources));
+    } else {
+      KMessageBox::sorry(this, i18n("The following fields are not defined for the requested file:\n%1").arg(invalidSources));
+    }
+  }
+  
   file->writeUnlock();
   file = 0L;



More information about the Kst mailing list