KIO
kfilecopytomenu.cpp
85KFileCopyToMainMenu::KFileCopyToMainMenu(QMenu *parent, KFileCopyToMenuPrivate *_d, MenuType menuType)
90 , m_recentDirsGroup(KSharedConfig::openConfig(), m_menuType == Copy ? QStringLiteral("kuick-copy") : QStringLiteral("kuick-move"))
146 auto *browseAction = new QAction(i18nc("@action:inmenu in Copy To or Move To submenu", "Browse…"), this);
157 const QString text = KStringHandler::csqueeze(url.toDisplayString(QUrl::PreferLocalFile), 60); // shorten very long paths (#61386)
168 const QUrl dest = QFileDialog::getExistingDirectoryUrl(d->m_parentWidget ? d->m_parentWidget : this);
186 if (!recentDirs.contains(niceDest)) { // don't change position if already there, moving stuff is bad usability
201 KIO::CopyJob *job = m_menuType == Copy ? KIO::copy(d->m_urls, dirDest) : KIO::move(d->m_urls, dirDest);
214KFileCopyToDirectoryMenu::KFileCopyToDirectoryMenu(QMenu *parent, KFileCopyToMainMenu *mainMenu, const QString &path)
219 connect(this, &KFileCopyToDirectoryMenu::aboutToShow, this, &KFileCopyToDirectoryMenu::slotAboutToShow);
225 QAction *act = new QAction(m_mainMenu->menuType() == Copy ? i18nc("@title:menu", "Copy Here") : i18nc("@title:menu", "Move Here"), this);
238 const QStringList entries = dir.entryList(QDir::Dirs | QDir::NoDotAndDotDot, QDir::LocaleAware);
This class adds "Copy To" and "Move To" submenus to a popupmenu.
Definition kfilecopytomenu.h:26
KFileCopyToMenu(QWidget *parentWidget)
Creates a KFileCopyToMenu instance Note that this instance (and the widget) must stay alive for at le...
Definition kfilecopytomenu.cpp:45
void setAutoErrorHandlingEnabled(bool b)
Enables or disables automatic error handling with message boxes.
Definition kfilecopytomenu.cpp:63
void setReadOnly(bool ro)
If setReadOnly(true) is called, the "Move To" submenu will not appear.
Definition kfilecopytomenu.cpp:58
void setUrls(const QList< QUrl > &urls)
Sets the URLs which the actions apply to.
Definition kfilecopytomenu.cpp:53
void addActionsTo(QMenu *menu) const
Generate the actions and submenus, and adds them to the menu.
Definition kfilecopytomenu.cpp:68
CopyJob is used to move, copy or symlink files and directories.
void recordCopyJob(KIO::CopyJob *copyJob)
Record this CopyJob while it's happening and add a command for it so that the user can undo it.
Definition fileundomanager.cpp:272
void setAutoErrorHandlingEnabled(bool enable)
virtual QString errorString() const
int error() const
void result(KJob *job)
KJobUiDelegate * uiDelegate() const
QString i18nc(const char *context, const char *text, const TYPE &arg...)
Type type(const QSqlDatabase &db)
KIOCORE_EXPORT CopyJob * move(const QUrl &src, const QUrl &dest, JobFlags flags=DefaultFlags)
Moves a file or directory src to the given destination dest.
Definition copyjob.cpp:2657
KIOCORE_EXPORT CopyJob * copy(const QUrl &src, const QUrl &dest, JobFlags flags=DefaultFlags)
Copy a file or directory src into the destination dest, which can be a file (including the final file...
Definition copyjob.cpp:2635
void setWindow(QObject *job, QWidget *widget)
QString path(const QString &relativePath)
KIOCORE_EXPORT QString dir(const QString &fileClass)
Returns the most recently used directory associated with this file-class.
Definition krecentdirs.cpp:41
KGuiItem clear()
KCOREADDONS_EXPORT QString csqueeze(const QString &str, int maxlen=40)
QVariant data() const const
void setEnabled(bool)
void setData(const QVariant &data)
void triggered(bool checked)
Dirs
LocaleAware
QFileInfoList drives()
QString homePath()
QString rootPath()
QUrl getExistingDirectoryUrl(QWidget *parent, const QString &caption, const QUrl &dir, Options options, const QStringList &supportedSchemes)
void setItalic(bool enable)
QIcon fromTheme(const QString &name)
iterator begin()
iterator end()
iterator erase(const_iterator begin, const_iterator end)
void prepend(parameter_type value)
qsizetype size() const const
QMimeType mimeTypeForName(const QString &nameOrAlias) const const
iconName
QMetaObject::Connection connect(const QObject *sender, PointerToMemberFunction signal, Functor functor)
void setObjectName(QAnyStringView name)
bool contains(QLatin1StringView str, Qt::CaseSensitivity cs) const const
QFuture< ArgsType< Signal > > connect(Sender *sender, Signal signal)
PreferLocalFile
QUrl fromLocalFile(const QString &localFile)
bool isEmpty() const const
QString toDisplayString(FormattingOptions options) const const
QUrl toUrl() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:16:28 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:16:28 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.