Ignore:
Timestamp:
Aug 31, 2016, 5:31:04 PM (9 years ago)
Author:
Silvan Scherrer
Message:

smplayer: update trunk to version 16.8.0

Location:
smplayer/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • smplayer/trunk

  • smplayer/trunk/src/deviceinfo.cpp

    r176 r181  
    2727DeviceList DeviceInfo::retrieveDevices(DeviceType type) {
    2828        qDebug("DeviceInfo::retrieveDevices: %d", type);
    29        
     29
     30        DeviceList l;
     31
     32        #ifdef CACHE_DEVICE_INFO
    3033        QString inifile = Paths::configPath() + "/device_info.ini";
    3134        QSettings set(inifile, QSettings::IniFormat);
    32         QString section_name = "display_devices";
    33         if (type == Sound) section_name = "dsound_devices";
    34        
     35        QString section_name = "display-devices";
     36        if (type == Sound) section_name = "dsound-devices";
     37
    3538        // Check if we already have the list stored in the INI file
    36         DeviceList l = loadList(&set, section_name);
     39        l = loadList(&set, section_name);
    3740        if (l.count() > 0) return l;
    38        
     41        #endif
     42
    3943        QRegExp rx_device("^(\\d+): (.*)");
    40        
     44
    4145        if (QFile::exists("dxlist.exe")) {
    4246                QProcess p;
     
    6064                }
    6165        }
    62        
     66
     67        #ifdef CACHE_DEVICE_INFO
    6368        saveList(&set, section_name, l);
    64        
     69        #endif
     70
    6571        return l;
    6672}
     
    7985        qDebug("DeviceInfo::alsaDevices");
    8086
     87        DeviceList l;
     88
     89        #ifdef CACHE_DEVICE_INFO
    8190        QString inifile = Paths::configPath() + "/device_info.ini";
    8291        QSettings set(inifile, QSettings::IniFormat);
    8392
    8493        // Check if we already have the list stored in the INI file
    85         DeviceList l = loadList(&set, "alsa_devices");
     94        l = loadList(&set, "alsa-devices");
    8695        if (l.count() > 0) return l;
     96        #endif
    8797
    8898        QRegExp rx_device("^card\\s([0-9]+).*\\[(.*)\\],\\sdevice\\s([0-9]+):");
     
    111121        }
    112122
    113         saveList(&set, "alsa_devices", l);
     123        #ifdef CACHE_DEVICE_INFO
     124        saveList(&set, "alsa-devices", l);
     125        #endif
    114126
    115127        return l;
     
    119131        qDebug("DeviceInfo::xvAdaptors");
    120132
     133        DeviceList l;
     134
     135        #ifdef CACHE_DEVICE_INFO
    121136        QString inifile = Paths::configPath() + "/device_info.ini";
    122137        QSettings set(inifile, QSettings::IniFormat);
    123138
    124139        // Check if we already have the list stored in the INI file
    125         DeviceList l = loadList(&set, "xv_adaptors");
     140        l = loadList(&set, "xv-adaptors");
    126141        if (l.count() > 0) return l;
     142        #endif
    127143
    128144        QRegExp rx_device("^.*Adaptor #([0-9]+): \"(.*)\"");
     
    149165        }
    150166
    151         saveList(&set, "xv_adaptors", l);
     167        #ifdef CACHE_DEVICE_INFO
     168        saveList(&set, "xv-adaptors", l);
     169        #endif
    152170
    153171        return l;
     
    156174#endif
    157175
     176#ifdef CACHE_DEVICE_INFO
    158177void DeviceInfo::saveList(QSettings * set, const QString & section_name, const DeviceList & list) {
    159178        set->beginWriteArray(section_name);
     
    161180                set->setArrayIndex(i);
    162181                set->setValue("ID", list.at(i).ID());
    163                 set->setValue("password", list.at(i).desc());
     182                set->setValue("description", list.at(i).desc());
    164183        }
    165184        set->endArray();
     
    173192                set->setArrayIndex(i);
    174193                QVariant id = set->value("ID");
    175                 QString desc = set->value("password", "").toString();
     194                QString desc = set->value("description", "").toString();
    176195                l.append(DeviceData(id, desc));
    177196        }
     
    181200        return l;
    182201}
     202#endif
Note: See TracChangeset for help on using the changeset viewer.