summaryrefslogtreecommitdiffstats
path: root/src/corelib/io/qurl.h
diff options
context:
space:
mode:
authorDavid Faure <david.faure@kdab.com>2014-04-23 22:59:34 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-05-06 01:20:17 +0200
commit31ce6f50c679e61dc53f09ee1b1637918da38a82 (patch)
tree12f8fe00be487990f586b2675e40294e486a1245 /src/corelib/io/qurl.h
parentda24bfe1f7f8a4ece2c1bb9998d6f99f7b4fb137 (diff)
Add QUrl::fromUserInput overload with a cwd argument.
Useful for any application that can take URLs on the command-line, so that full paths and relative paths can also be accepted. Change-Id: I8a2c50f36d60bdc49c065b3065972fd5d45fa12a Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/io/qurl.h')
-rw-r--r--src/corelib/io/qurl.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/corelib/io/qurl.h b/src/corelib/io/qurl.h
index 602e91ce30..d621d7ef03 100644
--- a/src/corelib/io/qurl.h
+++ b/src/corelib/io/qurl.h
@@ -199,7 +199,16 @@ public:
QByteArray toEncoded(FormattingOptions options = FullyEncoded) const;
static QUrl fromEncoded(const QByteArray &url, ParsingMode mode = TolerantMode);
+ enum UserInputResolutionOption {
+ DefaultResolution,
+ AssumeLocalFile
+ };
+ Q_DECLARE_FLAGS(UserInputResolutionOptions, UserInputResolutionOption)
+
static QUrl fromUserInput(const QString &userInput);
+ // ### Qt6 merge with fromUserInput(QString), by adding = QString()
+ static QUrl fromUserInput(const QString &userInput, const QString &workingDirectory,
+ UserInputResolutionOptions options = DefaultResolution);
bool isValid() const;
QString errorString() const;