kget
newtransferdialog.cpp
Go to the documentation of this file.
78 connect(ui.groupComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(setDefaultDestination()));
166 if (sourceUrl.url() != KUrl(sourceUrl.url()).fileName()) {//TODO simplify, whatfor is this check anyway, shouldn't the sources be checked already and if not add this to UrlChecker
182 ui.destRequester->setUrl(QString(ui.destRequester->url().path(KUrl::AddTrailingSlash) + filename));
211 //TODO handle the case where for some there are suggested file names --> own file name column in multiple setting
236 //NOTE if the user enters a file name manually and the changes the group the manually entered file name will be overwritten
252 KWindowInfo info = KWindowSystem::windowInfo(m_window->winId(), NET::WMDesktop, NET::WMDesktop);
336 warningText = i18n("Files that exist already in the current folder have been marked.");//TODO better message
350 m_existingTransfer = UrlChecker::existingTransfer(m_destination, UrlChecker::Destination, &warning);
397 //an existing transfer has been specified and since ok was clicked, it was chosen to be overwritten
418 //removes m_destination if it exists, do that here so that it is removed no matter if a transfer could be created or not
442 //removes destUrl if it exists, do that here so that it is removed no matter if a transfer could be created or not
505 QHash<int, UrlData>::iterator itUrls = newTransferDialogHandler->m_urls.insert(newTransferDialogHandler->m_nextJobId, UrlData());
531 } else if (!lastUrl.isValid() || (lastUrl.scheme().isEmpty() && lastUrl.directory().isEmpty())) {
532 // Sometimes valid filenames are not recognised by KURL::isLocalFile(), they are marked as invalid then
549 folder = urls.last().path(KUrl::AddTrailingSlash);//checks if that folder is correct happen later
559 (*itUrls).suggestedFileName = KUrl(suggestedFileName).pathOrUrl();//pathOrUrl to get a non percent encoded url
567 connect(job, SIGNAL(result(KJob*)), newTransferDialogHandler, SLOT(slotMostLocalUrlResult(KJob*)));
603 if (!folder.isEmpty() && (UrlChecker::checkFolder(KUrl(folder), true) != UrlChecker::NoError)) {
639 } else if (((!groups.isEmpty() && !Settings::directoriesAsSuggestion()) || !Settings::askForDestination()) &&
679 //there are still some unhandled urls, i.e. for those no group could be found, add them with an empty group
755 if ((!m_dialog || m_dialog->isEmpty()) && urls.count() == 1) {//FIXME why the m_dialog check? whenever a dialog has been created this would not be shown?
760 dialog = factory->createNewTransferDialog(url, suggestedFileName, !groups.isEmpty() ? groups.first() : 0);
762 KWindowInfo info = KWindowSystem::windowInfo(KGet::m_mainWindow->winId(), NET::WMDesktop, NET::WMDesktop);
781 void NewTransferDialogHandler::createDialog(const KUrl::List &urls, const QString &suggestedFileName)
This class provides static methods to check if urls are valid, and if not provides enums to see what ...
Definition: urlchecker.h:34
static QString generalDestDir(bool preferXDGDownloadDir=false)
Returns a download directory.
Definition: kget.cpp:945
QBrush background() const
void setDefaultDestination()
Called when the transfer group or the urlREquester changed, the dialog sets the default destination f...
Definition: newtransferdialog.cpp:234
QString & append(QChar ch)
Definition: urlchecker.h:61
iterator insert(const Key &key, const T &value)
Qt::CheckState checkState() const
virtual KDialog * createNewTransferDialog(const KUrl &srcUrl, const QString &suggestedFileName=QString(), TransferGroupHandler *defaultGroup=0)
Definition: transferfactory.cpp:50
Definition: transfergrouphandler.h:30
QStringList split(const QString &sep, SplitBehavior behavior, Qt::CaseSensitivity cs) const
int removeDuplicates()
Definition: newtransferdialog.h:104
static UrlError checkDestination(const KUrl &destination, bool showNotification=false)
Convenience method of checkUrl.
Definition: urlchecker.cpp:166
typedef Alignment
static bool matchesExceptions(const KUrl &sourceUrl, const QStringList &patterns)
Returns true if sourceUrl matches any of the patterns.
Definition: kget.cpp:743
static QList< TransferGroupHandler * > allTransferGroups()
Gets all transfer-groups.
Definition: kget.cpp:668
static KJob * deleteFile(const KUrl &dest, QObject *receiver=0, const char *method=0)
Starts the deletion of dest and emits KJob::finished once done.
Definition: filedeleter.cpp:73
void clear()
const char * name() const
int count(const T &value) const
Definition: urlchecker.h:40
QClipboard * clipboard()
Definition: urlchecker.h:38
static KUrl destUrl(const KUrl &destOrFolder, const KUrl &source, const QString &fileName=QString())
Takes an url to a source and an url to either the destination or a folder and returns a destination u...
Definition: urlchecker.cpp:225
bool isEmpty() const
KUrl mostLocalUrl() const
Call this in the slot connected to result.
Definition: mostlocalurl.cpp:57
bool isEmpty() const
QString trimmed() const
bool endsWith(const QString &s, Qt::CaseSensitivity cs) const
Dialog to allow add one or more transfers to kget.
Definition: newtransferdialog.h:35
T & first()
void setCheckState(Qt::CheckState state)
int remove(const Key &key)
void setBackground(const QBrush &brush)
Job for asynchronously getting the most local url, do not use directly, but use mostLocalUrlJob inste...
Definition: mostlocalurl.h:54
NewTransferDialogHandler(QObject *parent=0)
NOTE some checks in this class might seem redundant, though target is to display as few dialogs...
Definition: newtransferdialog.cpp:482
static QString message(const KUrl &url, const UrlType type, const UrlError error)
Get a describing message for UrlError.
Definition: urlchecker.cpp:290
iterator erase(iterator pos)
static TransferHandler * existingTransfer(const KUrl &url, const UrlType type, UrlWarning *warning=0)
Checks if there is an existing transfer for url with type.
Definition: urlchecker.cpp:242
iterator find(const Key &key)
static QList< TransferGroupHandler * > groupsFromExceptions(const KUrl &filename)
Definition: kget.cpp:730
Definition: urlchecker.h:74
static UrlError checkSource(const KUrl &source, bool showNotification=false)
Convenience method of checkUrl.
Definition: urlchecker.cpp:139
bool isAbsolutePath(const QString &path)
static void removeDuplicates(KUrl::List &urls)
Removes duplicates of a list of urls.
Definition: urlchecker.cpp:113
static void showNewTransferDialog(const KUrl &url=KUrl())
Definition: newtransferdialog.cpp:493
Definition: urlchecker.h:39
int count() const
~NewTransferDialogHandler()
Definition: newtransferdialog.cpp:488
QString pattern() const
void start(int msec)
TransferData(const KUrl &src, const KUrl &dest, const QString &groupName=QString(), bool start=false, const QDomElement *e=0)
iterator end()
bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
Definition: urlchecker.h:80
static UrlError checkFolder(const KUrl &folder, bool showNotification=false)
Convenience method of checkUrl.
Definition: urlchecker.cpp:195
static bool wouldOverwrite(const KUrl &source, const KUrl &dest)
Checks if source is local and exists already.
Definition: urlchecker.cpp:134
iterator begin()
QString text() const
static bool delTransfer(TransferHandler *transfer, DeleteMode mode=AutoDelete)
Removes a transfer from the KGet.
Definition: kget.cpp:362
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:28:43 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:28:43 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.