diff options
author | Arno <am@disconnect.de> | 2014-02-15 04:55:46 +0100 |
---|---|---|
committer | Arno <am@disconnect.de> | 2014-02-15 04:55:46 +0100 |
commit | 816b84b7a4263c587c661e4c7178f3b6721e4cfe (patch) | |
tree | d5d6bd412d26b29f053ba7f3135f85b01dae08a7 /archivecontroller.cpp | |
parent | dcbf9244f0ed147a5f3c412b9e83c581b58fa1b2 (diff) | |
download | SheMov-816b84b7a4263c587c661e4c7178f3b6721e4cfe.tar.gz SheMov-816b84b7a4263c587c661e4c7178f3b6721e4cfe.tar.bz2 SheMov-816b84b7a4263c587c661e4c7178f3b6721e4cfe.zip |
Replace ArchiveModel::FileType with #define
These constants are used all over the place and aren't really specific
to ArchiveModel, so use the preprocessor.
Diffstat (limited to 'archivecontroller.cpp')
-rw-r--r-- | archivecontroller.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/archivecontroller.cpp b/archivecontroller.cpp index 574b9c1..a7d0501 100644 --- a/archivecontroller.cpp +++ b/archivecontroller.cpp @@ -71,7 +71,7 @@ void ArchiveController::playSelectedFiles(){ QModelIndexList sel = mFileSelection->selectedRows(); QStringList files; foreach(QModelIndex i, sel){ - if(i.data(ArchiveFilesModel::FileTypeRole).toInt() == ArchiveFilesModel::Movie){ + if(i.data(ArchiveFilesModel::FileTypeRole).toInt() == FT_MOVIE){ QString fullPath = i.data(ArchiveFilesModel::FullPathRole).toString(); QFileInfo fi(fullPath); if(fi.exists()){ @@ -132,13 +132,13 @@ void ArchiveController::editFileType(){ if(ok && !item.isEmpty()){ int newType = 0; if(item == tr("Movie")){ - newType = ArchiveFilesModel::Movie; + newType = FT_MOVIE; }else if(item == tr("Front Cover")){ - newType = ArchiveFilesModel::FrontCover; + newType = FT_FRONTCOVER; }else if(item == tr("Back Cover")){ - newType = ArchiveFilesModel::BackCover; + newType = FT_BACKCOVER; }else if(item == tr("General Cover")){ - newType = ArchiveFilesModel::GeneralCover; + newType = FT_GENERALCOVER; } if(newType){ foreach(QModelIndex i, sel){ @@ -189,7 +189,7 @@ void ArchiveController::showPreview(){ QFileInfo fi(first); if(!fi.exists()){ pv->setFile(); - }else if(sel.first().data(ArchiveFilesModel::FileTypeRole).toInt() == ArchiveFilesModel::Movie){ + }else if(sel.first().data(ArchiveFilesModel::FileTypeRole).toInt() == FT_MOVIE){ qApp->setOverrideCursor(Qt::BusyCursor); QPixmap preview = Helper::preview(first); if(!preview.isNull()){ @@ -279,7 +279,7 @@ void ArchiveController::fileSelectionChanged(const QItemSelection &selected, con foreach(QModelIndex i, sel){ size += i.data(ArchiveFilesModel::SizeRole).toInt(); int type = i.data(ArchiveFilesModel::FileTypeRole).toInt(); - if(type == ArchiveFilesModel::Movie){ + if(type == FT_MOVIE){ int dur = i.data(ArchiveFilesModel::SizeDurRole).toInt(); duration += dur; if(dur == 0){ @@ -296,7 +296,7 @@ void ArchiveController::fileDoubleClicked(const QModelIndex &idx){ return; } int type = idx.data(ArchiveFilesModel::FileTypeRole).toInt(); - if(type == ArchiveFilesModel::Movie){ + if(type == FT_MOVIE){ QString fullPath = idx.data(ArchiveFilesModel::FullPathRole).toString(); QFileInfo fi(fullPath); if(!fi.exists()){ |