KFile
knewfilemenu.cpp
Go to the documentation of this file.
475 // We don't set the text of lineEdit in its constructor because the clear button would not be shown then.
476 // It seems that setClearButtonShown(true) must be called *before* the text is set to make it work.
499 KNameAndUrlInputDialog* dlg = new KNameAndUrlInputDialog(i18n("File name:"), entry.comment, m_popupFiles.first(), m_parentWidget);
530 KMimeType::Ptr mime = KMimeType::findByNameAndContent(m_copyData.m_chosenFileName, srcFile.read(1024));
568 KNameAndUrlInputDialog* dlg = new KNameAndUrlInputDialog(i18n("File name:"), entry.comment, m_popupFiles.first(), m_parentWidget);
613 // The best way to identify the "Create Directory", "Link to Location", "Link to Application" was the template
718 q->trigger(); // was for kdesktop's slotNewMenuActivated() in kde3 times. Can't hurt to keep it...
826 const QStringList files = m_actionCollection->componentData().dirs()->findAllResources("templates");
892 i18n("Basic links can only point to local files or directories.\nPlease use \"Link to Location\" for remote URLs."),
922 if (KUriFilter::self()->filterUri(uriData, QStringList() << QLatin1String("kshorturifilter"))) {
974 connect(d->m_newMenuGroup, SIGNAL(triggered(QAction*)), this, SLOT(_k_slotActionTriggered(QAction*)));
1029 if (baseUrl.isLocalFile() && QFileInfo(baseUrl.toLocalFile(KUrl::AddTrailingSlash) + name).exists())
1042 // We don't set the text of lineEdit in its constructor because the clear button would not be shown then.
1043 // It seems that setClearButtonShown(true) must be called *before* the text is set to make it work.
1049 d->_k_slotTextChanged(name); // have to save string in d->m_text in case user does not touch dialog
The 'Create New' submenu, for creating files using templates (e.g.
Definition: knewfilemenu.h:54
void setText(const QString &text)
KGuiItem cancel()
const_iterator constBegin() const
QString i18n(const char *text)
void setModal(bool modality)
Sets the modality of dialogs created by KNewFile.
Definition: knewfilemenu.cpp:1075
void truncate(int position)
void setModal(bool modal)
void setSupportedMimeTypes(const QStringList &mime)
Only show the files in a given set of mimetypes.
Definition: knewfilemenu.cpp:1104
void writePathEntry(const QString &pKey, const QString &path, WriteConfigFlags pFlags=Normal)
KUrl destUrl() const
void setSeparator(bool b)
QList< T > values() const
void checkUpToDate()
Checks if updating the list is necessary IMPORTANT : Call this in the slot for aboutToShow.
Definition: knewfilemenu.cpp:990
bool remove()
QString & prepend(QChar ch)
QVariant data() const
QString label(StandardShortcut id)
QStringList supportedMimeTypes() const
Returns the mimetypes set in supportedMimeTypes()
Definition: knewfilemenu.cpp:1144
void setIcon(const QIcon &icon)
KStandardDirs * dirs()
SimpleJob * mkdir(const KUrl &url, int permissions=-1)
static QDebug kError(bool cond, int area=KDE_DEFAULT_DEBUG_AREA)
void setAttribute(Qt::WidgetAttribute attribute, bool on)
void writeEntry(const QString &key, const QVariant &value, WriteConfigFlags pFlags=Normal)
void createDirectory()
Call this to create a new directory as if the user had done it using a popupmenu. ...
Definition: knewfilemenu.cpp:1020
QString toLocalFile(AdjustPathOption trailing=LeaveTrailingSlash) const
bool exists() const
const_iterator insert(const T &value)
QString & remove(int position, int n)
KActionMenu(QObject *parent)
static QDebug kDebug(bool cond, int area=KDE_DEFAULT_DEBUG_AREA)
bool isEmpty() const
QString toString(QFlags< QUrl::FormattingOption > options) const
static int createKMessageBox(KDialog *dialog, QMessageBox::Icon icon, const QString &text, const QStringList &strlist, const QString &ask, bool *checkboxReturn, Options options, const QString &details=QString())
static bool shouldBeShownContinue(const QString &dontShowAgainName)
CopyJob * copyAs(const KUrl &src, const KUrl &dest, JobFlags flags=DefaultFlags)
QString i18nc(const char *ctxt, const char *text)
KSharedConfigPtr config()
int lastIndexOf(QChar ch, int from, Qt::CaseSensitivity cs) const
void setPath(const QString &path)
void setData(const KUrl &url)
KUrl::List popupFiles() const
Returns the files that the popup is shown for.
Definition: knewfilemenu.cpp:1070
void setViewShowsHiddenFiles(bool b)
Set if the directory view currently shows dot files.
Definition: knewfilemenu.cpp:1109
const char * name() const
void addPath(const QString &txt)
void addWidget(QWidget *widget, int stretch, QFlags< Qt::AlignmentFlag > alignment)
QWidget * parentWidget() const
void append(const T &value)
void setPopupFiles(const KUrl::List &files)
Set the files the popup is shown for Call this before showing up the menu.
Definition: knewfilemenu.cpp:1080
static QString icon(const QString &protocol)
int toInt(bool *ok) const
void setParentWidget(QWidget *parentWidget)
Sets a parent widget for the dialogs shown by KNewFileMenu.
Definition: knewfilemenu.cpp:1099
virtual void slotResult(KJob *job)
Called when the job that copied the template has finished.
Definition: knewfilemenu.cpp:1114
QString encodeFileName(const QString &str)
void setFocus()
QString protocol() const
void setAutoRemove(bool b)
bool isEmpty() const
void directoryCreated(const KUrl &url)
Emitted once the directory url has been successfully created.
void setObjectName(const QString &name)
bool isEmpty() const
QString trimmed() const
static bool supportsMakeDir(const KUrl &url)
bool startsWith(const QString &s, Qt::CaseSensitivity cs) const
QString pathOrUrl() const
bool endsWith(const QString &s, Qt::CaseSensitivity cs) const
void fileCreated(const KUrl &url)
Emitted once the file (or symlink) url has been successfully created.
T & first()
void selectAll()
void setDefaultPermissions(bool b)
void setData(const QVariant &userData)
SimpleJob * symlink(const QString &target, const KUrl &dest, JobFlags flags=DefaultFlags)
static KUriFilter * self()
QStringList resourceDirs(const char *type) const
virtual void close()
bool contains(const T &value) const
static KUrl mostLocalUrl(const KUrl &url, QWidget *window)
QString fileName() const
void triggered(Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers)
static bool isDesktopFile(const QString &path)
QString fileName(const DirectoryOptions &options=IgnoreTrailingSlash) const
void setActionGroup(QActionGroup *group)
bool isRelative() const
void setCaption(const QString &c)
static QString suggestName(const KUrl &baseURL, const QString &oldName)
QString tildeExpand(const QString &path)
int length() const
static QDebug kWarning(bool cond, int area=KDE_DEFAULT_DEBUG_AREA)
QString left(int n) const
qint64 write(const char *data, qint64 maxSize)
void setClearButtonShown(bool show)
bool setProperty(const char *name, const QVariant &value)
iterator insert(const Key &key, const T &value)
K_GLOBAL_STATIC(KUrl, lastDirectory) static const char autocompletionWhatsThisText[]
KGuiItem cont()
KNewFileMenu(KActionCollection *collection, const QString &name, QObject *parent)
Constructor.
Definition: knewfilemenu.cpp:967
void show()
const_iterator constEnd() const
const_iterator constBegin() const
static FileUndoManager * self()
bool isLocalFile() const
bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
QObject * parent() const
virtual void setText(const QString &)
bool open()
int utime(const QString &filename, struct utimbuf *buf)
KUrl uri() const
static bool supportsWriting(const KUrl &url)
QString prettyUrl(AdjustPathOption trailing=LeaveTrailingSlash) const
void setCheckForExecutables(bool check)
QByteArray encodeName(const QString &fileName)
void recordJob(CommandType op, const KUrl::List &src, const KUrl &dst, KIO::Job *job)
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:27:27 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:27:27 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.