mirror of
https://github.com/KDE/konsole.git
synced 2026-06-12 16:05:45 -04:00
Refacotor the code for parsing and expanding environment variables.
The old cold is copied from kio/kurlcompletion.cpp, which is not very suitable for detecting and expanding environment variables. For example, it only sees ' ' and '/' as the end point of an environment variable. That assumption fails easily with the common example of "PATH=$PATH:~/bin"
This commit is contained in:
@@ -84,7 +84,15 @@ public:
|
||||
/** Expands environment variables in each string in @p list. */
|
||||
static QStringList expand(const QStringList& items);
|
||||
|
||||
|
||||
static bool isValidEnvCharacter(const QChar& ch);
|
||||
|
||||
static bool isValidLeadingEnvCharacter(const QChar& ch);
|
||||
|
||||
private:
|
||||
|
||||
static bool expandEnv(QString& text);
|
||||
|
||||
QStringList _arguments;
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user