~ubuntu-branches/ubuntu/wily/smplayer/wily

« back to all changes in this revision

Viewing changes to src/images.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Maia Kozheva
  • Date: 2009-03-31 23:05:43 UTC
  • mto: (1.1.9 upstream) (3.1.2 squeeze)
  • mto: This revision was merged to the branch mainline in revision 14.
  • Revision ID: james.westby@ubuntu.com-20090331230543-nsklbxenl2hf2n6h
ImportĀ upstreamĀ versionĀ 0.6.7

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*  smplayer, GUI front-end for mplayer.
2
 
    Copyright (C) 2006-2008 Ricardo Villalba <rvm@escomposlinux.org>
 
2
    Copyright (C) 2006-2009 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
21
21
#include "images.h"
22
22
#include "global.h"
23
23
#include "preferences.h"
24
 
#include "helper.h"
 
24
#include "paths.h"
25
25
 
26
26
#include <QFile>
27
27
 
39
39
        return filename;
40
40
}
41
41
 
 
42
QString Images::file(const QString & icon_name) {
 
43
        bool ok = false;
 
44
        QString filename;
 
45
 
 
46
        if (!pref->iconset.isEmpty()) {
 
47
                filename = Paths::configPath() + "/themes/" + pref->iconset + "/" +  icon_name;
 
48
                if (!QFile::exists(filename)) {
 
49
                        filename = Paths::themesPath() + "/" + pref->iconset + "/" +  icon_name;
 
50
                }
 
51
 
 
52
                ok = (QFile::exists(filename));
 
53
        }
 
54
 
 
55
        if (!ok) {
 
56
                filename = ":/icons-png/" + icon_name;
 
57
        }
 
58
 
 
59
        qDebug("Images::file: icon_name: '%s', filename: '%s'", icon_name.toUtf8().constData(), filename.toUtf8().constData());
 
60
 
 
61
        return filename;
 
62
}
 
63
 
42
64
QPixmap Images::loadIcon(const QString & icon_name) {
43
65
        QPixmap p;
44
66
 
45
67
        if (!pref->iconset.isEmpty()) {
46
 
                QString filename = Helper::appHomePath() + "/themes/" + pref->iconset + "/" +  icon_name;
 
68
                QString filename = Paths::configPath() + "/themes/" + pref->iconset + "/" +  icon_name;
47
69
                if (!QFile::exists(filename)) {
48
 
                        filename = Helper::themesPath() + "/" + pref->iconset + "/" +  icon_name;
 
70
                        filename = Paths::themesPath() + "/" + pref->iconset + "/" +  icon_name;
49
71
                }
50
72
                //qDebug("Images::loadIcon: filename: '%s'", filename.toUtf8().data());
51
73