Ticket #248: mythvideo-dvd-copy-feature.patch
File mythvideo-dvd-copy-feature.patch, 3.0 KB (added by , 19 years ago) |
---|
-
mythvideo/metadata.cpp
1 1 #include <qfile.h> 2 #include <qdir.h> 3 #include <qfileinfo.h> 2 4 #include <cmath> 3 5 #include <iostream> 4 6 #include <mythtv/mythdbcon.h> … … 76 78 } 77 79 } 78 80 81 bool Metadata::removeDir(QString& dirName) 82 { 83 QDir d(dirName); 84 85 const QFileInfoList *contents = d.entryInfoList(); 86 if (!contents) 87 { 88 return d.rmdir(dirName); 89 } 90 91 const QFileInfoListIterator it(*contents); 92 QFileInfo *fi; 93 94 while ((fi = it.current()) != 0) 95 { 96 if (fi->fileName() == "." || 97 fi->fileName() == "..") 98 { 99 continue; 100 } 101 if (fi->isDir()) 102 { 103 QString fileName = fi->fileName(); 104 if (!removeDir(fileName)) 105 return false; 106 } 107 else 108 { 109 if (!QFile(fi->fileName()).remove()) 110 return false; 111 } 112 } 113 return d.rmdir(dirName); 114 } 115 79 116 bool Metadata::Remove() 80 117 { 81 QFile videofile; 82 videofile.setName(filename); 83 bool isremoved = videofile.remove(); 118 bool isremoved = false; 119 QFileInfo fi(filename); 120 if (fi.isDir()) 121 { 122 isremoved = removeDir(filename); 123 } 124 else 125 { 126 QFile videofile; 127 videofile.setName(filename); 128 isremoved = videofile.remove(); 129 } 84 130 if (isremoved) 85 131 { 86 132 MSqlQuery query(MSqlQuery::InitCon()); -
mythvideo/dbcheck.cpp
96 96 " VALUES (\"vob\", \"\", 0, 1);", 97 97 "INSERT INTO videotypes (extension, playcommand, f_ignore, use_default)" 98 98 " VALUES (\"mpeg\", \"\", 0, 1);", 99 "INSERT INTO videotypes (extension, playcommand, f_ignore, use_default)" 100 " VALUES (\"VIDEO_TS\", \"mplayer -fs -zoom -quiet -vo xv -dvd-device %s dvd://1\", 0, 1);", 99 101 "" 100 102 }; 101 103 dbver = ""; -
mythvideo/videoscan.cpp
191 191 192 192 QString filename = fi->absFilePath(); 193 193 if (fi->isDir()) 194 buildFileList(filename, imageExtensions); 194 { 195 if (fi->fileName() == QString("VIDEO_TS") || 196 fi->fileName() == QString("video_ts")) 197 { 198 filename = fi->dirPath(true); 199 if (!filename.isEmpty()) 200 m_VideoFiles[filename] = kFileSystem; 201 } 202 else 203 buildFileList(filename, imageExtensions); 204 } 195 205 else 196 206 { 197 207 r.setPattern("^" + fi->extension() + "$"); -
mythvideo/metadata.h
181 181 void updateCountries(); 182 182 void fillGenres(); 183 183 void updateGenres(); 184 bool removeDir(QString& dirName); 184 185 QImage* coverImage; 185 186 QPixmap* coverPixmap; 186 187