~ubuntu-branches/ubuntu/hardy/kdenlive/hardy

« back to all changes in this revision

Viewing changes to kdenlive/projectformatmanager.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Albin Tonnerre
  • Date: 2008-01-30 17:07:51 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20080130170751-lyc8p6xvd7o98ur5
Tags: 0.5.svn20071228-0.0ubuntu1
* Merge from debian-multimedia (LP: #150453). Remaining changes:
  - Bump compat to 5
  - Suggest dvgrab and ffmpeg (needed for firewire capture)
  - debian/{rules,control}: add a kdenlive-data package
  - Add .install files for kdenlive and kdenlive-data
  - debian/copyright: add some copyright information
  - Modify Maintainer value to match the DebianMaintainerField specification

Show diffs side-by-side

added added

removed removed

Lines of Context:
98
98
            }
99
99
            KIO::NetAccess::removeTempFile(tmpfile);
100
100
            //document->initSceneListGeneration();
101
 
            QTimer::singleShot(200, document, SLOT(initSceneListGeneration()));
 
101
            QTimer::singleShot(500, document, SLOT(initSceneListGeneration()));
102
102
            return true;
103
103
        }
104
104
//      } else {
129
129
            }
130
130
            else result = true;
131
131
        } else {
 
132
            KMessageBox::sorry(0, i18n("Could not save file %1.\nPlease check your permissions").arg(file.name()));
 
133
            //kdError() << "Save failed" << endl;
 
134
        }
 
135
    }
 
136
 
 
137
    if (result) document->setModified(false);
 
138
    return result;
 
139
}
 
140
 
 
141
bool ProjectFormatManager::backupDocument(const KURL & url,
 
142
    KdenliveDoc * document)
 
143
{
 
144
    if (url.isEmpty())
 
145
        return false;
 
146
    bool result = false;
 
147
    KMimeType::Ptr format = KMimeType::findByURL(url);
 
148
    SaveProjectFilter *filter = m_saveFilters.first();
 
149
 
 
150
    if (filter) {
 
151
        KTempFile file;
 
152
        //file.setAutoDelete(true);
 
153
 
 
154
        if ((filter->save(*file.file(), document, false))) {
 
155
            file.close();
 
156
            if (!KIO::NetAccess::upload(file.name(), url, 0)) {
 
157
                //kdError() << "Could not upload file to correct location" << endl;
 
158
                KMessageBox::sorry(0, i18n("Could not save file %1.\nPlease check your permissions").arg(url.path()));
 
159
            }
 
160
            else result = true;
 
161
        } else {
132
162
            kdError() << "Save failed" << endl;
133
163
        }
134
164
    }
135
 
 
136
 
    if (result) document->setModified(false);
137
165
    return result;
138
166
}
139
167
 
151
179
findLoadFormat(const QString & format)
152
180
{
153
181
    QPtrListIterator < LoadProjectFilter > itt(m_loadFilters);
154
 
 
155
182
    while (itt.current()) {
156
183
        if (itt.current()->handlesFormat(format)) {
157
184
            return itt.current();
159
186
        ++itt;
160
187
    }
161
188
 
162
 
    return 0;
 
189
    return m_loadFilters.first();
163
190
}
164
191
 
165
192
SaveProjectFilter *ProjectFormatManager::
174
201
        ++itt;
175
202
    }
176
203
 
177
 
    return 0;
 
204
    return m_saveFilters.first();
178
205
}
179
206
 
180
207
/** Returns the mime types that can be loaded in */