Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

remove last KStandarddir and KPrograssdialog

parent c172e1c9
......@@ -26,6 +26,7 @@
#include <QVBoxLayout>
#include <QLineEdit>
#include <QPlainTextEdit>
#include <QStandardPaths>
EncodingProfilesDialog::EncodingProfilesDialog(int profileType, QWidget * parent) :
QDialog(parent),
......
......@@ -30,7 +30,7 @@
#include <KRun>
#include <KColorScheme>
#include <KNotification>
#include <KStandardDirs>
#include <QDomDocument>
#include <QTreeWidgetItem>
......@@ -916,7 +916,8 @@ void RenderWidget::slotPrepareExport(bool scriptExport)
if (m_view.create_chapter->isChecked()) chapterFile = m_view.out_file->url().path() + ".dvdchapter";
// mantisbt 1051
if (!KStandardDirs::makeDir(m_view.out_file->url().adjusted(QUrl::RemoveFilename).path())) {
QDir dir;
if (!dir.mkpath(m_view.out_file->url().adjusted(QUrl::RemoveFilename).path())) {
KMessageBox::sorry(this, i18n("The directory %1, could not be created.\nPlease make sure you have the required permissions.", m_view.out_file->url().adjusted(QUrl::RemoveFilename).path()));
return;
}
......@@ -2223,7 +2224,8 @@ QString RenderWidget::getFreeScriptName(const QUrl &projectName, const QString &
{
int ix = 0;
QString scriptsFolder = m_projectFolder + "scripts/";
KStandardDirs::makeDir(scriptsFolder);
QDir dir(m_projectFolder);
dir.mkdir("scripts");
QString path;
QString fileName;
if (projectName.isEmpty()) fileName = i18n("script");
......@@ -2373,6 +2375,3 @@ void RenderWidget::keyPressEvent(QKeyEvent *e) {
}
else QDialog::keyPressEvent(e);
}
#include "renderwidget.moc"
......@@ -35,7 +35,7 @@
#include <KProcess>
#include <KRun>
#include <KMessageWidget>
#include <KStandardDirs>
#include <QLabel>
#include <QMimeType>
......@@ -714,8 +714,9 @@ void Wizard::adjustSettings()
KdenliveSettings::setDefault_profile(selectedProfile);
}
QString path = m_extra.projectfolder->url().path();
if (KStandardDirs::makeDir(path) == false) {
//qDebug() << "/// ERROR CREATING PROJECT FOLDER: " << path;
QDir dir;
if (dir.mkpath(path) == false) {
qDebug() << "/// ERROR CREATING PROJECT FOLDER: " << path;
} else KdenliveSettings::setDefaultprojectfolder(path);
}
......
......@@ -35,9 +35,8 @@
#include "project/notesplugin.h"
#include "project/dialogs/noteswidget.h"
#include <KStandardDirs>
#include <KMessageBox>
#include <KProgressDialog>
#include <QProgressDialog>
#include <KLocalizedString>
#include <KIO/CopyJob>
#include <KIO/JobUiDelegate>
......@@ -63,7 +62,7 @@
const double DOCUMENTVERSION = 0.88;
KdenliveDoc::KdenliveDoc(const QUrl &url, const QUrl &projectFolder, QUndoGroup *undoGroup, const QString &profileName, const QMap <QString, QString>& properties, const QMap <QString, QString>& metadata, const QPoint &tracks, Render *render, NotesPlugin *notes, bool *openBackup, MainWindow *parent, KProgressDialog *progressDialog) :
KdenliveDoc::KdenliveDoc(const QUrl &url, const QUrl &projectFolder, QUndoGroup *undoGroup, const QString &profileName, const QMap <QString, QString>& properties, const QMap <QString, QString>& metadata, const QPoint &tracks, Render *render, NotesPlugin *notes, bool *openBackup, MainWindow *parent, QProgressDialog *progressDialog) :
QObject(parent),
m_autosave(NULL),
m_url(url),
......@@ -273,12 +272,14 @@ KdenliveDoc::KdenliveDoc(const QUrl &url, const QUrl &projectFolder, QUndoGroup
const int max = producers.count();
if (!progressDialog) {
progressDialog = new KProgressDialog(parent, i18n("Loading project"), i18n("Adding clips"));
progressDialog->setAllowCancel(false);
progressDialog = new QProgressDialog(parent);
progressDialog->setWindowTitle(i18n("Loading project"));
progressDialog->setLabelText(i18n("Adding clips"));
progressDialog->setCancelButton(0);
} else {
progressDialog->setLabelText(i18n("Adding clips"));
}
progressDialog->progressBar()->setMaximum(infomax);
progressDialog->setMaximum(infomax);
progressDialog->show();
qApp->processEvents();
......@@ -308,7 +309,7 @@ KdenliveDoc::KdenliveDoc(const QUrl &url, const QUrl &projectFolder, QUndoGroup
}
}
if (i % 10 == 0)
progressDialog->progressBar()->setValue(i);
progressDialog->setValue(i);
}
if (success) {
......@@ -374,9 +375,10 @@ KdenliveDoc::KdenliveDoc(const QUrl &url, const QUrl &projectFolder, QUndoGroup
}
// Make sure that the necessary folders exist
KStandardDirs::makeDir(m_projectFolder.path() + QDir::separator() + "titles/");
KStandardDirs::makeDir(m_projectFolder.path() + QDir::separator() + "thumbs/");
KStandardDirs::makeDir(m_projectFolder.path() + QDir::separator() + "proxy/");
QDir dir(m_projectFolder.path());
dir.mkdir("titles");
dir.mkdir("thumbs");
dir.mkdir("proxy");
updateProjectFolderPlacesEntry();
......@@ -839,10 +841,14 @@ void KdenliveDoc::setProjectFolder(QUrl url)
{
if (url == m_projectFolder) return;
setModified(true);
KStandardDirs::makeDir(url.path());
KStandardDirs::makeDir(url.path() + QDir::separator() + "titles/");
KStandardDirs::makeDir(url.path() + QDir::separator() + "thumbs/");
KStandardDirs::makeDir(url.path() + QDir::separator() + "proxy/");
QDir dir;
if (!QFileInfo::exists(url.path())) {
dir.mkpath(url.path());
}
dir.setPath(url.path());
dir.mkdir("titles");
dir.mkdir("thumbs");
dir.mkdir("proxy");
if (KMessageBox::questionYesNo(QApplication::activeWindow(), i18n("You have changed the project folder. Do you want to copy the cached data from %1 to the new folder %2?", m_projectFolder.path(), url.path())) == KMessageBox::Yes) moveProjectData(url);
m_projectFolder = url;
......@@ -1306,7 +1312,8 @@ void KdenliveDoc::slotCreateSlideshowClipFile(const QMap <QString, QString> &pro
void KdenliveDoc::slotCreateTextClip(QString group, const QString &groupId, const QString &templatePath)
{
QString titlesFolder = QDir::cleanPath(projectFolder().path() + QDir::separator() + "titles/");
KStandardDirs::makeDir(titlesFolder);
QDir dir(projectFolder().path());
dir.mkdir("titles");
QPointer<TitleWidget> dia_ui = new TitleWidget(templatePath, m_timecode, titlesFolder, m_render, QApplication::activeWindow());
if (dia_ui->exec() == QDialog::Accepted) {
m_clipManager->slotAddTextClipFile(i18n("Title clip"), dia_ui->duration(), dia_ui->xml().toString(), group, groupId);
......
......@@ -43,7 +43,7 @@ class TrackInfo;
class NotesPlugin;
class KTextEdit;
class KProgressDialog;
class QProgressDialog;
class QUndoGroup;
class QTimer;
class QUndoStack;
......@@ -53,7 +53,7 @@ class KdenliveDoc: public QObject
Q_OBJECT
public:
KdenliveDoc(const QUrl &url, const QUrl &projectFolder, QUndoGroup *undoGroup, const QString &profileName, const QMap <QString, QString>& properties, const QMap <QString, QString>& metadata, const QPoint &tracks, Render *render, NotesPlugin *notes, bool *openBackup, MainWindow *parent = 0, KProgressDialog *progressDialog = 0);
KdenliveDoc(const QUrl &url, const QUrl &projectFolder, QUndoGroup *undoGroup, const QString &profileName, const QMap <QString, QString>& properties, const QMap <QString, QString>& metadata, const QPoint &tracks, Render *render, NotesPlugin *notes, bool *openBackup, MainWindow *parent = 0, QProgressDialog *progressDialog = 0);
~KdenliveDoc();
QDomNodeList producersList();
double fps() const;
......
......@@ -36,6 +36,7 @@
#include <QTreeWidgetItem>
#include <QHeaderView>
#include <unistd.h>
#include <QStandardPaths>
DvdTreeWidget::DvdTreeWidget(QWidget *parent) :
QTreeWidget(parent)
......
......@@ -29,6 +29,7 @@
#include <QMenu>
#include <QDir>
#include <QStandardPaths>
EffectsListView::EffectsListView(QWidget *parent) :
QWidget(parent)
......
......@@ -38,6 +38,7 @@
#include <KComboBox>
#include <KLocalizedString>
#include <KMessageBox>
#include <QStandardPaths>
CollapsibleEffect::CollapsibleEffect(const QDomElement &effect, const QDomElement &original_effect, const ItemInfo &info, EffectMetaInfo *metaInfo, bool lastEffect, QWidget * parent) :
......
......@@ -34,6 +34,7 @@
#include <KLocalizedString>
#include <KMessageBox>
#include <KColorScheme>
#include <QStandardPaths>
MyEditableLabel::MyEditableLabel(QWidget * parent):
QLineEdit(parent)
......
......@@ -52,4 +52,4 @@ void JogManager::slotDoAction(const QString& actionName)
action->trigger();
}
#include "jogmanager.moc"
\ No newline at end of file
#include "jogmanager.moc"
......@@ -73,7 +73,6 @@
#include <KXMLGUIFactory>
#include <KColorSchemeManager>
#include <KStatusBar>
#include <KStandardDirs>
#include <KUrlRequesterDialog>
#include <QTemporaryFile>
#include <QMenu>
......@@ -1200,7 +1199,7 @@ void MainWindow::setStatusBarStyleSheet(const QPalette &p)
void MainWindow::saveOptions()
{
KdenliveSettings::self()->writeConfig();
KdenliveSettings::self()->save();
KSharedConfigPtr config = KSharedConfig::openConfig();
pCore->projectManager()->recentFilesAction()->saveEntries(KConfigGroup(config, "Recent Files"));
KConfigGroup treecolumns(config, "Project Tree");
......@@ -1222,11 +1221,12 @@ void MainWindow::readOptions()
if (initialGroup.readEntry("version") == "0.7") {
//Add new settings from 0.7.1
if (KdenliveSettings::defaultprojectfolder().isEmpty()) {
QString path = QDir::homePath() + "/kdenlive";
if (KStandardDirs::makeDir(path) == false) {
//qDebug() << "/// ERROR CREATING PROJECT FOLDER: " << path;
QDir dir(QDir::homePath());
if (!dir.mkdir("kdenlive")) {
qDebug() << "/// ERROR CREATING PROJECT FOLDER: ";
} else {
KdenliveSettings::setDefaultprojectfolder(path);
dir.cd("kdenlive");
KdenliveSettings::setDefaultprojectfolder(dir.path());
}
}
}
......
......@@ -54,7 +54,7 @@ ClipTranscode::ClipTranscode(const QList <QUrl> &urls, const QString &params, co
source_url->setUrl(m_urls.at(0));
dest_url->setMode(KFile::File);
dest_url->setUrl(dest);
dest_url->fileDialog()->setFileMode(QFileDialog::AnyFile);//OperationMode(KFileDialog::Saving);
dest_url->setMode(KFile::File);//OperationMode(KFileDialog::Saving);
urls_list->setHidden(true);
connect(source_url, SIGNAL(textChanged(QString)), this, SLOT(slotUpdateParams()));
} else {
......
......@@ -29,7 +29,7 @@
#include <KMessageBox>
#include <QDebug>
#include <kio/directorysizejob.h>
#include <KStandardDirs>
#include <KIO/FileCopyJob>
#include <QTemporaryFile>
......
......@@ -56,7 +56,7 @@
#include <QVBoxLayout>
#include <QHBoxLayout>
#include <KPassivePopup>
#include <KStandardDirs>
#ifdef USE_NEPOMUK
#include <nepomuk/global.h>
......@@ -1983,7 +1983,7 @@ void ProjectList::slotAddTitleTemplateClip()
mimeTypeFilters <<"application/x-kdenlivetitle";
dia_ui.template_list->setFilter(mimeTypeFilters.join(' '));
//warning: setting base directory doesn't work??
dia_ui.template_list->setPath(path);
dia_ui.template_list->setUrl(QUrl::fromLocalFile(path));
dia_ui.text_box->setHidden(true);
if (dia->exec() == QDialog::Accepted) {
QString textTemplate = dia_ui.template_list->comboBox()->itemData(dia_ui.template_list->comboBox()->currentIndex()).toString();
......@@ -3232,7 +3232,8 @@ void ProjectList::slotProxyCurrentItem(bool doProxy, ProjectItem *itemToProxy)
// Make sure the proxy folder exists
QString proxydir = m_doc->projectFolder().path() + QDir::separator() + "proxy/";
KStandardDirs::makeDir(proxydir);
QDir dir(m_doc->projectFolder().path());
dir.mkdir("proxy");
QMap <QString, QString> newProps;
QMap <QString, QString> oldProps;
......
......@@ -26,7 +26,7 @@ the Free Software Foundation, either version 3 of the License, or
#include <KActionCollection>
#include <QAction>
#include <KMessageBox>
#include <KProgressDialog>
#include <QProgressDialog>
#include <QCryptographicHash>
#include <QFileDialog>
......@@ -357,17 +357,19 @@ void ProjectManager::doOpenFile(const QUrl &url, KAutoSaveFile *stale)
pCore->window()->m_stopmotion = NULL;
}
KProgressDialog progressDialog(pCore->window(), i18n("Loading project"), i18n("Loading project"));
progressDialog.setAllowCancel(false);
progressDialog.progressBar()->setMaximum(4);
QProgressDialog progressDialog(pCore->window());
progressDialog.setWindowTitle(i18n("Loading project"));
progressDialog.setLabelText(i18n("Loading project"));
progressDialog.setCancelButton(0);
progressDialog.setMaximum(4);
progressDialog.show();
progressDialog.progressBar()->setValue(0);
progressDialog.setValue(0);
bool openBackup;
KdenliveDoc *doc = new KdenliveDoc(stale ? QUrl(stale->fileName()) : url, KdenliveSettings::defaultprojectfolder(), pCore->window()->m_commandStack, KdenliveSettings::default_profile(), QMap <QString, QString> (), QMap <QString, QString> (), QPoint(KdenliveSettings::videotracks(), KdenliveSettings::audiotracks()), pCore->monitorManager()->projectMonitor()->render, m_notesPlugin, &openBackup, pCore->window(), &progressDialog);
progressDialog.progressBar()->setValue(1);
progressDialog.progressBar()->setMaximum(4);
progressDialog.setValue(1);
progressDialog.setMaximum(4);
progressDialog.setLabelText(i18n("Loading project"));
progressDialog.repaint();
......@@ -383,7 +385,7 @@ void ProjectManager::doOpenFile(const QUrl &url, KAutoSaveFile *stale)
}
connect(doc, SIGNAL(progressInfo(QString,int)), pCore->window(), SLOT(slotGotProgressInfo(QString,int)));
progressDialog.progressBar()->setValue(2);
progressDialog.setValue(2);
progressDialog.repaint();
bool ok;
......@@ -392,7 +394,7 @@ void ProjectManager::doOpenFile(const QUrl &url, KAutoSaveFile *stale)
m_project = doc;
pCore->window()->connectDocument();
emit docOpened(m_project);
progressDialog.progressBar()->setValue(3);
progressDialog.setValue(3);
progressDialog.repaint();
pCore->window()->m_timelineArea->setCurrentIndex(pCore->window()->m_timelineArea->addTab(m_trackView, QIcon::fromTheme("kdenlive"), m_project->description()));
......@@ -409,7 +411,7 @@ void ProjectManager::doOpenFile(const QUrl &url, KAutoSaveFile *stale)
pCore->window()->slotGotProgressInfo(QString(), -1);
pCore->monitorManager()->projectMonitor()->adjustRulerSize(m_trackView->duration());
pCore->monitorManager()->projectMonitor()->slotZoneMoved(m_trackView->inPoint(), m_trackView->outPoint());
progressDialog.progressBar()->setValue(4);
progressDialog.setValue(4);
if (openBackup) {
slotOpenBackup(url);
}
......
......@@ -20,14 +20,13 @@
#include "kdenlivesettings.h"
#include "timecode.h"
#include <QDebug>
#include <QTemporaryFile>
#include <KLocalizedString>
#include <KMessageBox>
#include <KStandardDirs>
#include <KIO/FileCopyJob>
#include <QDebug>
#include <QTemporaryFile>
#include <QDir>
#include <QApplication>
#include <QGraphicsScene>
#include <QDomElement>
......@@ -112,7 +111,8 @@ int TitleDocument::base64ToUrl(QGraphicsItem* item, QDomElement& content, bool e
const QString TitleDocument::extractBase64Image(const QString &titlePath, const QString &data)
{
QString filename = titlePath + QString(QCryptographicHash::hash(data.toAscii(), QCryptographicHash::Md5).toHex().append(".titlepart"));
KStandardDirs::makeDir(titlePath);
QDir dir;
dir.mkpath(titlePath);
QFile f(filename);
if (f.open(QIODevice::WriteOnly)) {
f.write(QByteArray::fromBase64(data.toAscii())) ;
......
......@@ -24,7 +24,7 @@
#include <QImage>
#include <QVarLengthArray>
#include <kstandarddirs.h>
#include <krandomsequence.h>
#include <QDebug>
#include <ktempdir.h>
......
Markdown is supported
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