From: APTX <> Date: Sat, 11 Apr 2009 13:03:46 +0000 (+0200) Subject: - Default to closest existing directory if the last open file does not X-Git-Url: https://gitweb.tyo.aptx.org/?a=commitdiff_plain;h=27852d5348194b18417670386bb4764b945a0b29;p=aniplayer-old.git - Default to closest existing directory if the last open file does not exist --- diff --git a/aniplayer.pro b/aniplayer.pro index 03327aa..6e173eb 100644 --- a/aniplayer.pro +++ b/aniplayer.pro @@ -2,7 +2,7 @@ CONFIG += ordered TEMPLATE = subdirs #CONFIG += browserplugin - +#CONFIG += static SUBDIRS += lib \ src diff --git a/lib/anidbudpclient/anidbudpclient.pro b/lib/anidbudpclient/anidbudpclient.pro index 75e6829..ed9bfb8 100644 --- a/lib/anidbudpclient/anidbudpclient.pro +++ b/lib/anidbudpclient/anidbudpclient.pro @@ -5,7 +5,14 @@ QT += network QT -= gui TEMPLATE = lib TARGET = anidbudpclient -DESTDIR = ../../build +static { + message(anidbpudpclinet: Static build) + DESTDIR = ../../build-static +} +!static { + message(anidbpudpclinet: Dynamic build) + DESTDIR = ../../build +} INCLUDEPATH += $$PWD DEPENDPATH += $$PWD QT *= network diff --git a/src/directoryplaylist.cpp b/src/directoryplaylist.cpp index ce69fc5..4aa4529 100644 --- a/src/directoryplaylist.cpp +++ b/src/directoryplaylist.cpp @@ -42,7 +42,7 @@ bool DirectoryPlaylist::isEmpty() const int DirectoryPlaylist::count() const { - return m_directory.count(); + return entryList.count(); } int DirectoryPlaylist::currentIndex() const diff --git a/src/src.pro b/src/src.pro index 22e3c50..18e32c9 100644 --- a/src/src.pro +++ b/src/src.pro @@ -3,7 +3,6 @@ # ------------------------------------------------- QT += phonon -# CONFIG += static unix { message(Using system (KDE?) Phonon) QT -= phonon diff --git a/src/videowidget.h b/src/videowidget.h index 337adad..a3b8adf 100644 --- a/src/videowidget.h +++ b/src/videowidget.h @@ -4,7 +4,7 @@ #ifdef KDE_PHONON # include #else -# include +# include #endif class VideoWidget : public Phonon::VideoWidget diff --git a/src/videowindow.cpp b/src/videowindow.cpp index 28859d7..fc79c44 100644 --- a/src/videowindow.cpp +++ b/src/videowindow.cpp @@ -195,14 +195,19 @@ void VideoWindow::setMenuVisible(bool visible) void VideoWindow::open(bool closeOnStop) { QString dir; - QFileInfo fileInfo(m_currentFile); - if (fileInfo.exists()) + + if (m_currentFile == "") { - dir = fileInfo.absolutePath(); + dir = QDesktopServices::storageLocation(QDesktopServices::MoviesLocation); } else { - dir = QDesktopServices::storageLocation(QDesktopServices::MoviesLocation); + QFileInfo fileInfo(m_currentFile); + QDir dirObj = fileInfo.absoluteDir(); + while (!dirObj.exists()) + dirObj = dirObj.absolutePath() + "/.."; + + dir = dirObj.absolutePath(); } QString file = QFileDialog::getOpenFileName( @@ -729,11 +734,6 @@ void VideoWindow::loadSettings() anidb->setPass(settings.value("pass").toString()); m_automark = settings.value("automark", 0).toInt(); settings.endGroup(); - QFileInfo file(m_currentFile); - if (!file.exists()) - { - m_currentFile = ""; - } #endif }