Skip to content

Commit

Permalink
Make the FileScanner's location enum private and fix some locations w…
Browse files Browse the repository at this point in the history
…here sed had replaced the local kDatabase with MythDate::kDatabase.
  • Loading branch information
daniel-kristjansson committed Aug 20, 2011
1 parent 1a99f69 commit ce0aced
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 19 deletions.
21 changes: 11 additions & 10 deletions mythplugins/mythmusic/mythmusic/filescanner.cpp
Expand Up @@ -6,8 +6,9 @@
#include <QDir>

// MythTV headers
#include <mythcontext.h>
#include <util.h>
#include <mythdb.h>
#include <mythcontext.h>
#include <mythdialogs.h>
#include <mythscreenstack.h>
#include <mythprogressdialog.h>
Expand Down Expand Up @@ -141,7 +142,7 @@ void FileScanner::BuildFileList(QString &directory, MusicLoadedMap &music_files,
update_interval = 0;
}

music_files[filename] = kFileSystem;
music_files[filename] = FileScanner::kFileSystem;
}
}
}
Expand Down Expand Up @@ -611,11 +612,11 @@ void FileScanner::SearchDir(QString &directory)
uint counter = 0;
for (iter = music_files.begin(); iter != music_files.end(); iter++)
{
if (*iter == kFileSystem)
if (*iter == FileScanner::kFileSystem)
AddFileToDB(iter.key());
else if (*iter == MythDate::kDatabase)
else if (*iter == FileScanner::kDatabase)
RemoveFileFromDB(iter.key ());
else if (*iter == kNeedUpdate)
else if (*iter == FileScanner::kNeedUpdate)
UpdateFileInDB(iter.key());

if (file_checking)
Expand Down Expand Up @@ -681,7 +682,7 @@ void FileScanner::ScanMusic(MusicLoadedMap &music_files)
{
if ((iter = music_files.find(name)) != music_files.end())
{
if (music_files[name] == MythDate::kDatabase)
if (music_files[name] == FileScanner::kDatabase)
{
if (file_checking)
{
Expand All @@ -691,13 +692,13 @@ void FileScanner::ScanMusic(MusicLoadedMap &music_files)
continue;
}
else if (HasFileChanged(name, query.value(1).toString()))
music_files[name] = kNeedUpdate;
music_files[name] = FileScanner::kNeedUpdate;
else
music_files.erase(iter);
}
else
{
music_files[name] = kDatabase;
music_files[name] = FileScanner::kDatabase;
}
}

Expand Down Expand Up @@ -763,7 +764,7 @@ void FileScanner::ScanArtwork(MusicLoadedMap &music_files)
{
if ((iter = music_files.find(name)) != music_files.end())
{
if (music_files[name] == MythDate::kDatabase)
if (music_files[name] == FileScanner::kDatabase)
{
if (file_checking)
{
Expand All @@ -777,7 +778,7 @@ void FileScanner::ScanArtwork(MusicLoadedMap &music_files)
}
else
{
music_files[name] = kDatabase;
music_files[name] = FileScanner::kDatabase;
}
}
if (file_checking)
Expand Down
18 changes: 9 additions & 9 deletions mythplugins/mythmusic/mythmusic/filescanner.h
Expand Up @@ -4,19 +4,19 @@
class Metadata;
class Decoder;

enum MusicFileLocation
{
kFileSystem,
kDatabase,
kNeedUpdate,
kBoth
};

typedef QMap <QString, MusicFileLocation> MusicLoadedMap;
typedef QMap<QString, int> IdCache;

class FileScanner
{
enum MusicFileLocation
{
kFileSystem,
kDatabase,
kNeedUpdate,
kBoth
};

typedef QMap <QString, MusicFileLocation> MusicLoadedMap;
public:
FileScanner ();
~FileScanner ();
Expand Down

0 comments on commit ce0aced

Please sign in to comment.