Commit 1f01415b authored by Guillermo Molteni's avatar Guillermo Molteni Committed by Christoph Cullmann

Don't reverse order of files opened from the command line

Summary:
When you do kate file1 file2 file3, it will open tabs
in same order, file1 file2 file3.
In case of having kate opened, invoking it again with
kate file4 file5 file6 final result on tabs shall be
file4 file5 file6 file1 file2 file3
BUG: 397913

Reviewers: cullmann

Reviewed By: cullmann

Subscribers: zetazeta, cullmann, brauch, kwrite-devel

Tags: #kate

Differential Revision: https://phabricator.kde.org/D17145
parent fe8835d8
......@@ -175,7 +175,10 @@ bool KateApp::startupKate()
KTextEditor::Document *doc = nullptr;
const QString codec_name = codec ? QString::fromLatin1(codec->name()) : QString();
Q_FOREACH(const QString positionalArgument, m_args.positionalArguments()) {
// Bug 397913: Reverse the order here so the new tabs are opened in same order as the files were passed in on the command line
QString positionalArgument;
for (int i = m_args.positionalArguments().count() - 1; i >= 0; --i) {
positionalArgument = m_args.positionalArguments().at(i);
UrlInfo info(positionalArgument);
// this file is no local dir, open it, else warn
......
......@@ -416,7 +416,9 @@ int main(int argc, char **argv)
QStringList tokens;
// open given files...
foreach(const QString & url, urls) {
// Bug 397913: Reverse the order here so the new tabs are opened in same order as the files were passed in on the command line
for (int i = urls.size() - 1; i >= 0; --i) {
const QString &url = urls[i];
QDBusMessage m = QDBusMessage::createMethodCall(serviceName,
QStringLiteral("/MainApplication"), QStringLiteral("org.kde.Kate.Application"), QStringLiteral("tokenOpenUrlAt"));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment