[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: KDE/kdemultimedia/noatun/modules/splitplaylist
From: Stefan Gehn <mETz81 () web ! de>
Date: 2007-01-21 19:41:28
Message-ID: 1169408488.671724.18853.nullmailer () svn ! kde ! org
[Download RAW message or body]
SVN commit 625981 by metz:
- re-enable loading and saving of splitplaylist.xml
- remove workaround that opens a fileselector at startup
M +18 -26 view.cpp
--- trunk/KDE/kdemultimedia/noatun/modules/splitplaylist/view.cpp #625980:625981
@@ -317,8 +317,10 @@
if (item && item->item() == this)
{
p->save();
+
// p->setRasterOp(XorROP); // TODO KDE4 XXX
- // p->fillRect(0, 0, width, height(), QColor(255,255,255));
+ p->setOpacity(0.25);
+ p->fillRect(0, 0, width, height(), Qt::white);
p->restore();
}
@@ -745,10 +747,8 @@
applyMainWindowSettings(KGlobal::config(), "SPL Window");
list->setFocus();
- //kDebug(66666) << k_funcinfo << "END" << endl;
- // FIXME: kde4 workaround to automatically open file chooser
- QTimer::singleShot(1000, this, SLOT(addFiles()));
+ //kDebug(66666) << k_funcinfo << "END" << endl;
}
@@ -764,24 +764,11 @@
void View::init()
{
//kDebug(66666) << k_funcinfo << "BEGIN" << endl;
- // see if we are importing an old-style list
-// TODO KDE4
-/* bool importing = !QFile(locateLocal("data", "noatun/") + \
"splitplaylist.xml").exists();
- if (importing)
- {
- KUrl internalURL;
- internalURL.setPath(locateLocal("data", "noatun/") + "splitplaylistdata");
- NoatunSaver saver(list, 0);
- saver.load(internalURL, PlaylistSaver::M3U);
- }
- else
- {
- KUrl internalURL;
- internalURL.setPath(locateLocal("data", "noatun/") + "splitplaylist.xml");
- list->openGlobal(internalURL);
- }
-*/
+ KUrl internalURL;
+ internalURL.setPath(KStandardDirs::locateLocal("appdata", "splitplaylist.xml"));
+ list->openGlobal(internalURL);
+
KConfig &config = *KGlobal::config();
config.setGroup("splitplaylist");
@@ -919,20 +906,20 @@
void View::save()
{
- if(mPlaylistFile.isEmpty() || !mPlaylistFile.isValid())
+ if (mPlaylistFile.isEmpty() || !mPlaylistFile.isValid())
{
saveAs();
return;
}
- if(saveToURL(mPlaylistFile))
+ if (saveToURL(mPlaylistFile))
setModified(false);
}
void View::saveAs()
{
- KUrl u=KFileDialog::getSaveUrl(KUrl(), "*.xml splitplaylistdata *.pls *.m3u\n*", \
this, i18n("Save Playlist")); + KUrl u = KFileDialog::getSaveUrl(KUrl(), "*.xml \
splitplaylistdata *.pls *.m3u\n*", this, i18n("Save Playlist")); if(!u.isValid())
return;
mPlaylistFile = u;
@@ -1059,12 +1046,17 @@
KConfig &config = *KGlobal::config();
config.setGroup("splitplaylist");
+ // remember if the playlist has been saved
config.writeEntry("modified", modified);
+
+ // real location of playlist file
config.writePathEntry("file", mPlaylistFile.path());
-// saveToURL(locateLocal("data", "noatun/") + "splitplaylist.xml");
+ // save playlist in state-file
+ saveToURL(KStandardDirs::locateLocal("appdata", "splitplaylist.xml"));
+
unsigned int i;
- PlaylistItem item=SPL->getFirst();
+ PlaylistItem item = SPL->getFirst();
for(i = 0; item && item != SPL->current(); )
item=SPL->getAfter(item), i++;
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic