MCPcopy Create free account
hub / github.com/KDE/kdevelop / urlInfo

Function urlInfo

kdevplatform/shell/openprojectdialog.cpp:42–65  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

40};
41
42URLInfo urlInfo(const QUrl& url)
43{
44 URLInfo ret;
45 ret.isValid = false;
46
47 if (url.isLocalFile()) {
48 QFileInfo info(url.toLocalFile());
49 ret.isValid = info.exists();
50 if (ret.isValid) {
51 ret.isDir = info.isDir();
52 ret.extension = info.suffix();
53 }
54 } else if (url.isValid()) {
55 KIO::StatJob* statJob = KIO::stat(url, KIO::HideProgressInfo);
56 KJobWidgets::setWindow(statJob, KDevelop::Core::self()->uiControllerInternal()->defaultMainWindow());
57 ret.isValid = statJob->exec(); // TODO: do this asynchronously so that the user isn't blocked while typing every letter of the hostname in sftp://hostname
58 if (ret.isValid) {
59 KIO::UDSEntry entry = statJob->statResult();
60 ret.isDir = entry.isDir();
61 ret.extension = QFileInfo(entry.stringValue(KIO::UDSEntry::UDS_NAME)).suffix();
62 }
63 }
64 return ret;
65}
66
67QString configGroupName()
68{

Callers 2

execNativeDialogMethod · 0.85
validateOpenUrlMethod · 0.85

Calls 10

statClass · 0.85
isLocalFileMethod · 0.80
toLocalFileMethod · 0.80
existsMethod · 0.80
defaultMainWindowMethod · 0.80
uiControllerInternalMethod · 0.80
execMethod · 0.80
stringValueMethod · 0.80
QFileInfoClass · 0.50
isValidMethod · 0.45

Tested by

no test coverage detected