]> Some of my projects - aniplayer2.git/commitdiff
Try both the absolute and canonical file path with LML.
authorAPTX <marek321@gmail.com>
Sun, 16 Feb 2014 13:07:12 +0000 (14:07 +0100)
committerAPTX <marek321@gmail.com>
Sun, 16 Feb 2014 13:07:12 +0000 (14:07 +0100)
aniplayer/aniplayer.cpp

index f37b5c4f69536d6221084c63a2990c5a81b1d8aa..ea46629c727cf31613df6ef656899644dbae944d 100644 (file)
@@ -5,6 +5,8 @@
 
 #include <LocalMyList/MyList>
 
+#include <QDebug>
+
 AniPlayer::AniPlayer(QObject *parent) : QObject(parent), m_state(NoFileLoaded)
 {
        m_automark = 0;
@@ -192,11 +194,16 @@ void AniPlayer::markWatched()
                return;
 
        using namespace LocalMyList;
-       File f = MyList::instance()->database()->getFileByPath(QFileInfo(currentFile()).canonicalFilePath());
+       qDebug() << "path" << currentFile()<< QFileInfo(currentFile()).absoluteFilePath() << QFileInfo(currentFile()).canonicalFilePath();
+       File f = MyList::instance()->database()->getFileByPath(QFileInfo(currentFile()).absoluteFilePath());
        if (!f.fid)
        {
-               emit message(tr("File not in LocalMyList!"));
-               return;
+               f = MyList::instance()->database()->getFileByPath(QFileInfo(currentFile()).canonicalFilePath());
+               if (!f.fid)
+               {
+                       emit message(tr("File not in LocalMyList!"));
+                       return;
+               }
        }
        if (f.myWatched.isValid())
        {