/[qspeakers]/speakerdb.cpp
ViewVC logotype

Diff of /speakerdb.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 126 by ben, Mon Oct 20 20:11:01 2014 UTC revision 127, Sat Jun 25 01:07:49 2016 UTC
# Line 246  QDateTime SpeakerDb::lastModified() Line 246  QDateTime SpeakerDb::lastModified()
246    
247  QDateTime SpeakerDb::pkgInstalled()  QDateTime SpeakerDb::pkgInstalled()
248  {  {
249      QFileInfo info(PKG_DB);      QFile pkg_db(PKG_DB);
250      return info.lastModified();      if (pkg_db.exists()) {
251            QFileInfo info(PKG_DB);
252            return info.lastModified();
253        }
254    
255        /* necessary for ms-win32 */
256        QFile cwd_db(DB_FILENAME);
257        if (cwd_db.exists()) {
258            QFileInfo info(DB_FILENAME);
259            return info.lastModified();
260        }
261    
262        qWarning() << "no pkg db found, returning current datetime as db access!";
263        return QDateTime();
264  }  }
265    
266  QString SpeakerDb::pkgPath()  QString SpeakerDb::pkgPath()
267  {  {
268      return PKG_DB;      QFile pkg_db(PKG_DB);
269        if (pkg_db.exists())
270            return PKG_DB;
271    
272        /* necessary for ms-win32 */
273        QFile cwd_db(DB_FILENAME);
274        if (cwd_db.exists())
275            return DB_FILENAME;
276    
277        qWarning() << "no pkg db found, return empty path!";
278        return QString();
279  }  }
280    
281  QList<Speaker> SpeakerDb::getByFs(double min, double max)  QList<Speaker> SpeakerDb::getByFs(double min, double max)

Legend:
Removed from v.126  
changed lines
  Added in v.127

  ViewVC Help
Powered by ViewVC 1.1.26