Commit 05174118 authored by Jean-Baptiste Mardelle's avatar Jean-Baptiste Mardelle
Browse files

cleanup

parent c5f07dfc
......@@ -744,8 +744,14 @@ void KdenliveDoc::setProjectFolder(QUrl url)
updateProjectFolderPlacesEntry();
}
void KdenliveDoc::moveProjectData(const QUrl &url)
void KdenliveDoc::moveProjectData(const QString &src, const QString &dest)
{
// Move tmp folder (thumbnails, timeline preview)
KIO::CopyJob *copyJob = KIO::move(QUrl::fromLocalFile(src),QUrl::fromLocalFile(dest));
connect(copyJob, SIGNAL(result(KJob *)), this, SLOT(slotMoveFinished(KJob *)));
connect(copyJob, SIGNAL(percent(KJob *, unsigned long)), this, SLOT(slotMoveProgress(KJob *, unsigned long)));
// Move proxies
QList <ClipController*> list = pCore->binController()->getControllerList();
QList<QUrl> cacheUrls;
for (int i = 0; i < list.count(); ++i) {
......@@ -754,7 +760,7 @@ void KdenliveDoc::moveProjectData(const QUrl &url)
// the image for title clip must be moved
QUrl oldUrl = clip->clipUrl();
if (!oldUrl.isEmpty()) {
QUrl newUrl = QUrl::fromLocalFile(url.toLocalFile() + QStringLiteral("/titles/") + oldUrl.fileName());
QUrl newUrl = QUrl::fromLocalFile(dest + QStringLiteral("/titles/") + oldUrl.fileName());
KIO::Job *job = KIO::copy(oldUrl, newUrl);
if (job->exec()) clip->setProperty(QStringLiteral("resource"), newUrl.path());
}
......@@ -769,7 +775,7 @@ void KdenliveDoc::moveProjectData(const QUrl &url)
}
}
if (!cacheUrls.isEmpty()) {
QDir proxyDir(url.path() + "/proxy/");
QDir proxyDir(dest + "/proxy/");
if (proxyDir.mkpath(QStringLiteral("."))) {
KIO::CopyJob *job = KIO::move(cacheUrls, QUrl::fromLocalFile(proxyDir.absolutePath()));
KJobWidgets::setWindow(job, QApplication::activeWindow());
......
......@@ -174,7 +174,7 @@ public:
/** @brief Returns true if advanced compositing is available */
static int compositingMode();
/** @brief Move project data files to new url */
void moveProjectData(const QUrl &url);
void moveProjectData(const QString &src, const QString &dest);
private:
QUrl m_url;
......
......@@ -1728,7 +1728,7 @@ void MainWindow::slotEditProjectSettings()
KMessageBox::sorry(this, i18n("Cannot perform operation, target directory already exists: %1", newDir.absoluteFilePath(documentId)));
} else {
// Proceed with the move
pCore->projectManager()->moveDataFolder(oldDir.absoluteFilePath(documentId), newDir.absolutePath());
project->moveProjectData(oldDir.absoluteFilePath(documentId), newDir.absolutePath());
}
}
}
......
......@@ -796,16 +796,6 @@ void ProjectManager::saveZone(QStringList info, QDir dir)
pCore->bin()->saveZone(info, dir);
}
void ProjectManager::moveDataFolder(const QString &src, const QString &dest)
{
// Move tmp folder (thumbnails, timeline preview)
KIO::CopyJob *copyJob = KIO::move(QUrl::fromLocalFile(src),QUrl::fromLocalFile(dest));
connect(copyJob, SIGNAL(result(KJob *)), this, SLOT(slotMoveFinished(KJob *)));
connect(copyJob, SIGNAL(percent(KJob *, unsigned long)), this, SLOT(slotMoveProgress(KJob *, unsigned long)));
// Move proxies
m_project->moveProjectData(QUrl::fromLocalFile(dest));
}
void ProjectManager::slotMoveProgress(KJob *, unsigned long progress)
{
pCore->window()->slotGotProgressInfo(i18n("Moving project folder"), progress, ProcessingJobMessage);
......
......@@ -64,8 +64,6 @@ public:
/** @brief returns a default hd profile depending on timezone*/
static QString getDefaultProjectFormat();
void saveZone(QStringList info, QDir dir);
/** @brief Move the current project's data folder */
void moveDataFolder(const QString &src, const QString &dest);
public slots:
void newFile(bool showProjectSettings = true, bool force = false);
......
......@@ -49,7 +49,7 @@ bool GuideManager::mousePress(QMouseEvent *, ItemInfo info, QList<QGraphicsItem
return false;
}
bool GuideManager::mouseMove(QMouseEvent *event, int pos, int)
bool GuideManager::mouseMove(QMouseEvent *event, int, int)
{
event->accept();
return false;
......
......@@ -77,7 +77,7 @@ bool SelectManager::mousePress(QMouseEvent *event, ItemInfo info, QList<QGraphic
return false;
}
bool SelectManager::mouseMove(QMouseEvent *event, int pos, int)
bool SelectManager::mouseMove(QMouseEvent *event, int, int)
{
OperationType mode = m_view->operationMode();
if (mode == Seek) {
......
......@@ -87,6 +87,7 @@ bool SpacerManager::mouseMove(QMouseEvent *event, int pos, int )
void SpacerManager::mouseRelease(QMouseEvent *, GenTime pos)
{
//GenTime timeOffset = pos - m_startPos;
Q_UNUSED(pos);
if (!m_dragMoved || !m_view->selectionGroup()) {
m_view->clearSelection();
return;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment