]> Some of my projects - aniplayer-old.git/commitdiff
- Default to closest existing directory if the last open file does not
authorAPTX <>
Sat, 11 Apr 2009 13:03:46 +0000 (15:03 +0200)
committerAPTX <APTX@.(none)>
Sat, 11 Apr 2009 13:03:46 +0000 (15:03 +0200)
exist

aniplayer.pro
lib/anidbudpclient/anidbudpclient.pro
src/directoryplaylist.cpp
src/src.pro
src/videowidget.h
src/videowindow.cpp

index 03327aa48418cf5f262e8aa9ad3e5dd61b9457f8..6e173eb66d7f2fd1318fd1fabc3cfaca393fc50e 100644 (file)
@@ -2,7 +2,7 @@ CONFIG += ordered
 TEMPLATE = subdirs
 
 #CONFIG += browserplugin
-
+#CONFIG += static
 
 SUBDIRS +=  lib \
             src
index 75e6829da21c4e0db678df7c7a3e177ecdb60451..ed9bfb85d3124dae40548c16f35ddbb504e25d55 100644 (file)
@@ -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
index ce69fc5897767555a913ec1f83289ada5c4c8984..4aa4529b01caa73ad8eec95da87dd1225c3f225f 100644 (file)
@@ -42,7 +42,7 @@ bool DirectoryPlaylist::isEmpty() const
 
 int DirectoryPlaylist::count() const
 {
-       return m_directory.count();
+       return entryList.count();
 }
 
 int DirectoryPlaylist::currentIndex() const
index 22e3c502852eba97d7f7d8f4eb5f6e4802c5071f..18e32c9a25c7c7ec41c7e068e5fccbc6b45494b0 100644 (file)
@@ -3,7 +3,6 @@
 # -------------------------------------------------
 QT += phonon
 
-# CONFIG += static
 unix { 
     message(Using system (KDE?) Phonon)
     QT -= phonon
index 337adadf19de766ba7c6c678adcc8049c35a811f..a3b8adfd9f00ec67fafd6342399eb8ea566194ea 100644 (file)
@@ -4,7 +4,7 @@
 #ifdef KDE_PHONON
 #      include <phonon/videowidget.h>
 #else
-#      include <Phonon>
+#      include <Phonon/phonon>
 #endif
 
 class VideoWidget : public Phonon::VideoWidget
index 28859d7b207253cbf25c0a09c54d2a2df54b1764..fc79c444ba9b5cba43aa8363dfebb7ab4de25c9b 100644 (file)
@@ -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
 }