~ubuntu-branches/ubuntu/raring/muse/raring-proposed

« back to all changes in this revision

Viewing changes to muse/widgets/unusedwavefiles.cpp

  • Committer: Package Import Robot
  • Author(s): Alessio Treglia
  • Date: 2012-11-22 01:16:59 UTC
  • mto: This revision was merged to the branch mainline in revision 23.
  • Revision ID: package-import@ubuntu.com-20121122011659-a2fwbf33ceqe1s0t
Tags: upstream-2.1~rc1
ImportĀ upstreamĀ versionĀ 2.1~rc1

Show diffs side-by-side

added added

removed removed

Lines of Context:
56
56
    QStringList filter;
57
57
    filter.append("*.wav");
58
58
    filter.append("*.ogg");
 
59
    filter.append("*.flac");
59
60
    allWaveFiles= dir.entryList(filter);
60
 
    if (!allWaveFiles.count())
 
61
    if (allWaveFiles.count() == 0)
61
62
        return;
 
63
 
62
64
    // get med files
63
65
    QStringList medFiles;
64
66
    if (ui->currentProjRadioButton->isChecked()) {
68
70
        QStringList medFilter("*.med");
69
71
        medFiles = dir.entryList(medFilter);
70
72
    }
 
73
 
71
74
    foreach (QString medFile, medFiles) {
72
75
        QString fname = MusEGlobal::museProject+"/"+ medFile;
73
76
        //printf("fopen %s\n", fname.toLatin1().data());
75
78
        QTextStream fileContent(fp);
76
79
        while (!fileContent.atEnd()) {
77
80
            QString line = fileContent.readLine();
78
 
            if (line.contains(".wav") || line.contains(".ogg")) { // optimization
 
81
            if (line.contains(".wav") || line.contains(".ogg") || line.contains(".flac")) { // optimization
79
82
                foreach (QString wav, allWaveFiles) {
80
83
                    //printf("checking wav [%s]\n", wav.toLatin1().data() );
81
84
                    if (line.contains(wav)) {
112
115
            // move the wca file if it exists
113
116
            QFileInfo wf(MusEGlobal::museProject + "/" + file);
114
117
            if (QFile::exists(MusEGlobal::museProject + "/" + wf.baseName()+".wca")) {
115
 
                QFile::rename(MusEGlobal::museProject + "/" + wf.baseName()+".wca", MusEGlobal::museProject + "/unused/" +wf.baseName()+".wca");
 
118
                QFile::rename(MusEGlobal::museProject + "/" + wf.baseName()+".wca",
 
119
                              MusEGlobal::museProject + "/unused/" +wf.baseName()+".wca");
116
120
 
117
121
            }
118
122
        }