[Kst] kdeextragear-2/kst/kst
Rick Chern
rchern at interchange.ubc.ca
Wed Aug 25 21:09:57 CEST 2004
CVS commit by rchern:
When creating a new window name, try not to suggest an existing one (this can happen when a new window is created after loading a .kst file).
M +6 -1 kstdefaultnames.cpp 1.7
--- kdeextragear-2/kst/kst/kstdefaultnames.cpp #1.6:1.7
@@ -16,4 +16,5 @@
***************************************************************************/
+#include "kst.h"
#include "kstdatacollection.h"
#include "kstdefaultnames.h"
@@ -32,5 +33,9 @@ QString KST::suggestPlotName() {
QString KST::suggestWinName() {
static int last = 0;
- return QString("W%1").arg(++last);
+ QString suggestedName = "W" + QString::number(++last);
+ while (KstApp::inst()->findWindow(suggestedName)) {
+ suggestedName = "W" + QString::number(++last);
+ }
+ return suggestedName;
}
More information about the Kst
mailing list