~blathers16/ubuntu/precise/smplayer/add_quicklist

« back to all changes in this revision

Viewing changes to src/prefdrives.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Matvey Kozhev
  • Date: 2008-01-31 13:44:53 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20080131134453-nc4dwsn5pkiw5s9h
Tags: 0.6.0~rc1-1
* New upstream release.
* debian/control:
  - Build-depend on CDBS.
  - Updated upstream homepage.
* debian/copyright:
  - Updated download address.
* debian/rules:
  - Migrated to CDBS.
  - Tweaked get-orig-source to work with release candidates.
* debian/docs:
  - Removed Translations.txt, upstream removed it from the tarball.
  - Added Release_notes.txt.
* debian/manpages, debian/smplayer.1:
  - Deleted, manpage merged upstream.
* debian/smplayer.install:
  - Install usr/share/man.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*  smplayer, GUI front-end for mplayer.
2
 
    Copyright (C) 2007 Ricardo Villalba <rvm@escomposlinux.org>
 
2
    Copyright (C) 2006-2008 Ricardo Villalba <rvm@escomposlinux.org>
3
3
 
4
4
    This program is free software; you can redistribute it and/or modify
5
5
    it under the terms of the GNU General Public License as published by
25
25
#include <QFileInfoList>
26
26
#include <QDir>
27
27
 
 
28
#ifdef Q_OS_WIN
 
29
#include <windows.h>
 
30
 
 
31
bool isCDDevice(QString drive) {
 
32
        if (QSysInfo::WindowsVersion >= QSysInfo::WV_NT) {
 
33
                unsigned int r =  GetDriveTypeW((LPCWSTR) drive.utf16());
 
34
                qDebug("isCDDevice: '%s' r: %d", drive.toUtf8().data(), r);
 
35
                return (r == DRIVE_CDROM);
 
36
        } else {
 
37
                //Win98
 
38
                return true;
 
39
        }
 
40
}
 
41
 
 
42
#endif
 
43
 
28
44
PrefDrives::PrefDrives(QWidget * parent, Qt::WindowFlags f)
29
45
        : PrefWidget(parent, f )
30
46
{
36
52
        QFileInfoList list = QDir::drives();
37
53
        for (int n = 0; n < list.size(); n++) {
38
54
                QString s = list[n].filePath();
39
 
                if (s.endsWith("/")) s = s.remove( s.length()-1,1);
40
 
                dvd_device_combo->addItem( s );
41
 
                cdrom_device_combo->addItem( s );
 
55
                if (isCDDevice(s)) {
 
56
                        if (s.endsWith("/")) s = s.remove( s.length()-1,1);
 
57
                        dvd_device_combo->addItem( s );
 
58
                        cdrom_device_combo->addItem( s );
 
59
                }
42
60
        }
43
61
#else
44
62
#define ADD_IF_EXISTS( string ) \