~ubuntu-branches/ubuntu/utopic/psi/utopic

« back to all changes in this revision

Viewing changes to src/tools/iconset/iconset.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Jan Niehusmann
  • Date: 2009-09-25 17:49:51 UTC
  • mfrom: (6.1.3 sid)
  • Revision ID: james.westby@ubuntu.com-20090925174951-lvm7kdap82o8xhn3
Tags: 0.13-1
* Updated to upstream version 0.13
* Set Standards-Version to 3.8.3

Show diffs side-by-side

added added

removed removed

Lines of Context:
50
50
#endif
51
51
 
52
52
#ifdef ICONSET_ZIP
53
 
#       include "zip.h"
 
53
#       include "../zip/zip.h"
54
54
#endif
55
55
 
56
56
#include <QApplication>
258
258
                impix = from.impix;
259
259
                anim = from.anim ? new Anim ( *from.anim ) : 0;
260
260
                icon = 0;
 
261
                activatedCount = from.activatedCount;
261
262
        }
262
 
        
 
263
 
263
264
        void unloadAnim()
264
265
        {
265
266
                if ( anim )
1012
1013
 
1013
1014
                QFileInfo fi(dir);
1014
1015
                if ( fi.isDir() ) {
1015
 
                        QFile file ( dir + "/" + fileName );
 
1016
                        QFile file ( dir + '/' + fileName );
1016
1017
                        if (!file.open(IO_ReadOnly))
1017
1018
                                return ba;
1018
1019
 
1024
1025
                        if ( !z.open() )
1025
1026
                                return ba;
1026
1027
 
1027
 
                        QString n = fi.baseName(true) + "/" + fileName;
 
1028
                        QString n = fi.baseName(true) + '/' + fileName;
1028
1029
                        if ( !z.readFile(n, &ba) ) {
1029
1030
                                n = "/" + fileName;
1030
1031
                                z.readFile(n, &ba);
1219
1220
                                                        break;
1220
1221
 
1221
1222
                                                QFileInfo ext(sound[*it]);
1222
 
                                                path += "/" + QCA::Hash("sha1").hashToString(QString(fi.absFilePath() + "/" + *sound[*it]).utf8()) + "." + ext.extension();
 
1223
                                                path += "/" + QCA::Hash("sha1").hashToString(QString(fi.absFilePath() + '/' + *sound[*it]).utf8()) + '.' + ext.extension();
1223
1224
 
1224
1225
                                                QFile file ( path );
1225
1226
                                                file.open ( IO_WriteOnly );
1233
1234
#endif
1234
1235
                                        }
1235
1236
                                        else {
1236
 
                                                icon.setSound ( fi.absFilePath() + "/" + *sound[*it] );
 
1237
                                                icon.setSound ( fi.absFilePath() + '/' + *sound[*it] );
1237
1238
                                                break;
1238
1239
                                        }
1239
1240
                                }
1254
1255
 
1255
1256
                icon.blockSignals(false);
1256
1257
 
1257
 
                if ( loadSuccess )
 
1258
                if ( loadSuccess ) {
1258
1259
                        append( name, new PsiIcon(icon) );
 
1260
                } else {
 
1261
                        qWarning("can't load icon because of unknown type");
 
1262
                }
1259
1263
 
1260
1264
                return loadSuccess;
1261
1265
        }
1264
1268
        bool load(const QDomDocument &doc, const QString dir)
1265
1269
        {
1266
1270
                QDomElement base = doc.documentElement();
1267
 
                if ( base.tagName() != "icondef" )
 
1271
                if ( base.tagName() != "icondef" ) {
 
1272
                        qWarning("failed to load iconset invalid toplevel xml element");
1268
1273
                        return false;
 
1274
                }
1269
1275
 
1270
1276
                bool success = true;
1271
1277
 
1429
1435
                }
1430
1436
                else
1431
1437
                        qWarning("Iconset::load(): Failed to load iconset: icondef.xml is invalid XML");
 
1438
        } else {
 
1439
                qWarning("Iconset::load(): Failed to load iconset.xml");
1432
1440
        }
1433
1441
 
1434
1442
        //QPixmap::setDefaultOptimization( optimization );