[Kst] extragear/graphics/kst/kst
George Staikos
staikos at kde.org
Tue Nov 8 05:11:33 CET 2005
SVN commit 478846 by staikos:
some cleanup while hunting the KRecentFilesAction bug
M +11 -16 kst.cpp
M +1 -1 kst.h
M +12 -6 kstquickstartdialog_i.cpp
--- trunk/extragear/graphics/kst/kst/kst.cpp #478845:478846
@@ -418,9 +418,8 @@
KStdAction::open(this, SLOT(slotFileOpen()), actionCollection());
/************/
- recent = KStdAction::openRecent(this, SLOT(slotFileOpenRecent(const KURL &)),
- actionCollection());
- recent->setWhatsThis(i18n("Open a recently used Kst plot."));
+ _recent = KStdAction::openRecent(this, SLOT(slotFileOpenRecent(const KURL &)), actionCollection());
+ _recent->setWhatsThis(i18n("Open a recently used Kst plot."));
/************/
PauseAction = new KToggleAction(i18n("P&ause"),"player_pause", 0,
@@ -924,23 +923,19 @@
void KstApp::addRecentFile(const KURL& url) {
- recent->addURL(url);
+ _recent->addURL(url);
}
void KstApp::selectRecentFile(const KURL &url) {
- QStringList urls;
- int count;
- int i;
-
if (url.isEmpty()) {
- recent->setCurrentItem(-1);
+ _recent->setCurrentItem(-1);
} else {
- urls = recent->items();
- count = urls.count();
- for (i=0; i<count; i++) {
+ QStringList urls = _recent->items();
+ int count = urls.count();
+ for (int i = 0; i < count; ++i) {
if (KURL(urls[i]) == url) {
- recent->setCurrentItem(i);
+ _recent->setCurrentItem(i);
break;
}
}
@@ -1015,7 +1010,7 @@
void KstApp::saveOptions() {
config->setGroup("General Options");
- recent->saveEntries(config, "Recent Files");
+ _recent->saveEntries(config, "Recent Files");
config->writeEntry("MDIMode", (int)mdiMode());
@@ -1027,7 +1022,7 @@
void KstApp::readOptions() {
config->setGroup("General Options");
- recent->loadEntries(config, "Recent Files");
+ _recent->loadEntries(config, "Recent Files");
int mdiMode = config->readNumEntry("MDIMode", (int)KMdi::TabPageMode);
@@ -2456,7 +2451,7 @@
const QStringList KstApp::recentFiles() const {
- return recent->items();
+ return _recent->items();
}
--- trunk/extragear/graphics/kst/kst/kst.h #478845:478846
@@ -442,7 +442,7 @@
KstQuickStartDialogI *_quickStartDialog;
/* contains the recently used filenames */
- KRecentFilesAction *recent;
+ KRecentFilesAction *_recent;
KToggleAction *StatusBarAction;
--- trunk/extragear/graphics/kst/kst/kstquickstartdialog_i.cpp #478845:478846
@@ -29,8 +29,8 @@
#include "kstquickstartdialog_i.h"
#include "kstsettings.h"
-KstQuickStartDialogI::KstQuickStartDialogI(QWidget *parent, const char *name,
- bool modal, WFlags fl ) : KstQuickStartDialog(parent, name, modal, fl ) {
+KstQuickStartDialogI::KstQuickStartDialogI(QWidget *parent, const char *name, bool modal, WFlags fl)
+: KstQuickStartDialog(parent, name, modal, fl) {
_fileName->completionObject()->setDir(QDir::currentDirPath());
_app = KstApp::inst();
_isRecentFile = false;
@@ -42,21 +42,21 @@
connect(_recentFileList, SIGNAL(selected(const QString&)), this, SLOT(open_I()));
}
+
KstQuickStartDialogI::~KstQuickStartDialogI() {
-
}
+
void KstQuickStartDialogI::wizard_I() {
close();
_app->showDataWizard();
}
+
void KstQuickStartDialogI::open_I() {
if (_isRecentFile) {
if (_app->slotFileOpenRecent(_fileName->url())) {
- //
// select the recently opened file...
- //
_app->selectRecentFile(_fileName->url());
close();
}
@@ -65,6 +65,7 @@
}
}
+
void KstQuickStartDialogI::update() {
//get the list of recent files
_recentFileList->clear();
@@ -79,12 +80,14 @@
_showAtStartup->setChecked(KstSettings::globalSettings()->showQuickStart);
}
+
void KstQuickStartDialogI::show_I() {
update();
show();
raise();
}
+
void KstQuickStartDialogI::changeURL(const QString& name) {
_fileName->blockSignals(true);
_fileName->setURL(name);
@@ -92,15 +95,18 @@
_isRecentFile = true;
}
+
void KstQuickStartDialogI::updateSettings() {
- KstSettings::globalSettings()->showQuickStart=_showAtStartup->isChecked();
+ KstSettings::globalSettings()->showQuickStart = _showAtStartup->isChecked();
KstSettings::globalSettings()->save();
emit settingsChanged();
}
+
void KstQuickStartDialogI::deselectRecentFile() {
_recentFileList->clearSelection();
_isRecentFile = false;
}
+
#include "kstquickstartdialog_i.moc"
// vim: et ts=2 sw=2
More information about the Kst
mailing list