]> Some of my projects - aniplayer-old.git/commitdiff
Fix crash on opening file in a folder with files not recognized by DirectoryPlaylist.
authorAPTX <marek321@gmail.com>
Sun, 26 Dec 2010 03:28:04 +0000 (04:28 +0100)
committerAPTX <marek321@gmail.com>
Sun, 26 Dec 2010 03:28:04 +0000 (04:28 +0100)
src/directoryplaylist.cpp
src/src.pro
src/videowindow.cpp

index 0839d6a5a327296ca0999a7dcab19d8a5f20a86f..2bed72f5c39a9e11fcd807a8dea083a9c955be98 100644 (file)
@@ -26,7 +26,7 @@ void DirectoryPlaylist::setDirectory(QDir directory)
 
        updateEntrylist();
 
-       m_currentIndex = 0;
+       m_currentIndex = count() ? 0 : -1;
 }
 
 int DirectoryPlaylist::indexOfFile(const QString &file) const
@@ -109,6 +109,7 @@ void DirectoryPlaylist::updateEntrylist()
                                << "*.ogm"
                                << "*.wmv"
                                << "*.avi"
+                               << "*.mpg"
                                << "*.flv",
                        QDir::Files | QDir::Readable,
                        QDir::Name);
index 847b0808a5b6a17fbaa23df2243d029f332f4ac5..3e6f16035563e2b62a4453523e9bf6906fbc2171 100644 (file)
@@ -24,7 +24,8 @@ SOURCES += main.cpp \
     episodevotedialog.cpp \
     versiondialog.cpp \
     seekslider.cpp \
-    videoplayer.cpp
+       videoplayer.cpp \
+    anidbconfigdialog.cpp
 HEADERS += menu.h \
     videowindow.h \
     videowidget.h \
@@ -36,10 +37,12 @@ HEADERS += menu.h \
     versiondialog.h \
     constants.h \
     seekslider.h \
-    videoplayer.h
+       videoplayer.h \
+    anidbconfigdialog.h
 FORMS += menu.ui \
     anidbconfigdialog.ui \
-    episodevotedialog.ui
+    episodevotedialog.ui \
+    anidbconfigdialog.ui
 win32:RC_FILE += aniplayer.rc
 browserplugin { 
     # CONFIG += qaxserver
index 8c5d7a76e8bae52feaadd95f502e523670d3df3a..473cb8ca52c410bffec75e8b5dfb958e17d346a9 100644 (file)
@@ -227,7 +227,7 @@ bool VideoWindow::open(bool closeOnStop)
                        this,
                        tr("Open media"),
                        dir,
-                       tr("Video files (*.mkv *.mp4 *.ogg *.ogm *.wmv *.avi *.flv);;All files (*)")
+                       tr("Video files (*.mkv *.mp4 *.ogg *.ogm *.wmv *.avi *.mpg *.flv);;All files (*)")
                );
 
        if (file == "")
@@ -547,7 +547,6 @@ void VideoWindow::markWatched()
 
 void VideoWindow::markingStatus(AniDBUdpClient::File::Action action, AniDBUdpClient::File::ActionState actionState, int percent)
 {
-       qDebug() << "markingStatus called";
        AniDBUdpClient::File *file = (AniDBUdpClient::File *) sender();
        switch (action)
        {