Ignore:
Timestamp:
May 3, 2016, 2:14:41 PM (9 years ago)
Author:
Silvan Scherrer
Message:

smplayer: update vendor to version 16.4

File:
1 edited

Legend:

Unmodified
Added
Removed
  • smplayer/vendor/current/src/images.cpp

    r168 r175  
    11/*  smplayer, GUI front-end for mplayer.
    2     Copyright (C) 2006-2014 Ricardo Villalba <rvm@users.sourceforge.net>
     2    Copyright (C) 2006-2016 Ricardo Villalba <rvm@users.sourceforge.net>
    33
    44    This program is free software; you can redistribute it and/or modify
     
    3737#ifdef USE_RESOURCES
    3838QString Images::last_resource_loaded;
     39bool Images::has_rcc = false;
    3940
    4041QString Images::resourceFilename() {
     
    7172
    7273        QString rs_file = resourceFilename();
    73         if (QFile::exists(rs_file)) {
     74        if ((!rs_file.isEmpty()) && (QFile::exists(rs_file))) {
    7475                qDebug() << "Images::setTheme: loading" << rs_file;
    7576                QResource::registerResource(rs_file);
    7677                last_resource_loaded = rs_file;
     78                has_rcc = true;
     79        } else {
     80                has_rcc = false;
    7781        }
     82        qDebug() << "Images::setTheme: has_rcc:" << has_rcc;
    7883#endif
    7984}
     
    9196#endif
    9297
    93 #ifdef USE_RESOURCES
    94         QString icon_name = ":/" + current_theme + "/"+ name + ".png";
    95 #else
    96         QString icon_name = themes_path +"/"+ current_theme + "/"+ name + ".png";
    97 #endif
    98         if (!QFile::exists(icon_name)) {
    99                 icon_name = ":/icons-png/" + name + ".png";
     98        QString icon_name;
     99        if (!current_theme.isEmpty()) {
     100        #ifdef USE_RESOURCES
     101                if (has_rcc) {
     102                        icon_name = ":/" + current_theme + "/"+ name;
     103                } else {
     104                        icon_name = themes_path +"/"+ current_theme + "/"+ name;
     105                }
     106        #else
     107                icon_name = themes_path +"/"+ current_theme + "/"+ name;
     108        #endif
     109        }
     110
     111        bool has_extension = name.contains(".");
     112        if (!has_extension) icon_name += ".png";
     113
     114        //qDebug() << "Images::file:" << icon_name;
     115        if ((icon_name.isEmpty()) || (!QFile::exists(icon_name))) {
     116                icon_name = ":/default-theme/" + name;
     117                if (!has_extension) icon_name += ".png";
    100118        }
    101119
Note: See TracChangeset for help on using the changeset viewer.