[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [kde-baseapps/frameworks] lib/konq/src: Remove now unused newDir. Porting instructions in wiki.
From:       David Faure <faure () kde ! org>
Date:       2014-10-19 18:12:39
Message-ID: E1Xfuy7-0005tI-Px () scm ! kde ! org
[Download RAW message or body]

Git commit 178c1c639dccec486258719d723ae8b363e13dff by David Faure.
Committed on 19/10/2014 at 18:11.
Pushed by dfaure into branch 'frameworks'.

Remove now unused newDir. Porting instructions in wiki.

M  +0    -56   lib/konq/src/konq_operations.cpp
M  +0    -12   lib/konq/src/konq_operations.h

http://commits.kde.org/kde-baseapps/178c1c639dccec486258719d723ae8b363e13dff

diff --git a/lib/konq/src/konq_operations.cpp b/lib/konq/src/konq_operations.cpp
index fad013c..ee908c8 100644
--- a/lib/konq/src/konq_operations.cpp
+++ b/lib/konq/src/konq_operations.cpp
@@ -590,62 +590,6 @@ void KonqOperations::slotResult(KJob *job)
     deleteLater();
 }
 
-// Duplicated in KNewFileMenuPrivate::confirmCreatingHiddenDir (and this version \
                isn't kdelibs4support free, so use the other one)
-static bool confirmCreatingHiddenDir(const QString& name, QWidget* parent)
-{
-    KGuiItem continueGuiItem(KStandardGuiItem::cont());
-    continueGuiItem.setText(i18nc("@action:button", "Create directory"));
-    KGuiItem cancelGuiItem(KStandardGuiItem::cancel());
-    cancelGuiItem.setText(i18nc("@action:button", "Enter a different name"));
-    return KMessageBox::warningContinueCancel(
-        parent,
-        i18n("The name \"%1\" starts with a dot, so the directory will be hidden by \
                default.", name),
-        i18nc("@title:window", "Create hidden directory?"),
-        continueGuiItem,
-        cancelGuiItem,
-        "confirm_create_hidden_dir") == KMessageBox::Continue;
-}
-
-KIO::Job *KonqOperations::newDir(QWidget * parent, const QUrl &baseUrl, NewDirFlags \
                flags)
-{
-    bool ok;
-    QString name = i18nc( "@label Default name when creating a folder", "New Folder" \
                );
-    if ( baseUrl.isLocalFile() && QFileInfo(baseUrl.toLocalFile() + QLatin1Char('/') \
                + name).exists() ) {
-        name = KIO::suggestName(baseUrl, name);
-    }
-
-    bool askAgain;
-    do {
-        askAgain = false;
-        name = QInputDialog::getText(parent, i18nc( "@title:window", "New Folder" ),
-                                     i18nc( "@label:textbox", "Enter folder name:" \
                ), QLineEdit::Normal, name, &ok);
-        if ( ok && !name.isEmpty() ) {
-            QUrl url;
-            if (QDir::isAbsolutePath(name) || (name[0] == '~')) {
-                url = QUrl::fromLocalFile(KShell::tildeExpand(name));
-            } else {
-                const bool viewShowsHiddenFiles = (flags & ViewShowsHiddenFile);
-                if (!viewShowsHiddenFiles && name.startsWith('.')) {
-                    if (!confirmCreatingHiddenDir(name, parent)) {
-                        askAgain = true;
-                        continue;
-                    }
-                }
-                url = baseUrl;
-                url.setPath(baseUrl.path() + QLatin1Char('/') + name);
-            }
-            KIO::Job *job = KIO::mkpath(url, baseUrl);
-            KJobWidgets::setWindow(job, parent);
-            job->ui()->setAutoErrorHandlingEnabled(true);
-            KIO::FileUndoManager::self()->recordJob(KIO::FileUndoManager::Mkpath, \
                QList<QUrl>(), url, job);
-            return job;
-        }
-    } while (askAgain);
-    return 0;
-}
-
-////
-
 QWidget* KonqOperations::parentWidget() const
 {
     return static_cast<QWidget *>( parent() );
diff --git a/lib/konq/src/konq_operations.h b/lib/konq/src/konq_operations.h
index 44f6e03..fb1ab67 100644
--- a/lib/konq/src/konq_operations.h
+++ b/lib/konq/src/konq_operations.h
@@ -116,18 +116,6 @@ public:
      */
     static QPair<bool, QString> pasteInfo(const KUrl& targetUrl);
 
-    enum NewDirFlag { ViewShowsHiddenFile = 1 };
-    Q_DECLARE_FLAGS(NewDirFlags, NewDirFlag)
-    /**
-     * Ask for the name of a new directory and create it (using KIO::mkpath).
-     *
-     * @param parent the parent widget
-     * @param baseUrl the directory to create the new directory in
-     * @param flags see NewDirFlags
-     * @return the mkpath job used to create the directory or 0 if the creation was \
                cancelled by the user
-     */
-    static KIO::Job* newDir(QWidget *parent, const QUrl &baseUrl, NewDirFlags flags \
                = NewDirFlags());
-
     /**
      * Returns the list of dropped URL's.
      *


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic