Changeset View
Changeset View
Standalone View
Standalone View
kate/kateapp.cpp
Show First 20 Lines • Show All 183 Lines • ▼ Show 20 Line(s) | 180 | for (int i = m_args.positionalArguments().count() - 1; i >= 0; --i) { | |||
---|---|---|---|---|---|
184 | // this file is no local dir, open it, else warn | 184 | // this file is no local dir, open it, else warn | ||
185 | bool noDir = !info.url.isLocalFile() || !QFileInfo(info.url.toLocalFile()).isDir(); | 185 | bool noDir = !info.url.isLocalFile() || !QFileInfo(info.url.toLocalFile()).isDir(); | ||
186 | 186 | | |||
187 | if (noDir) { | 187 | if (noDir) { | ||
188 | doc = openDocUrl(info.url, codec_name, tempfileSet); | 188 | doc = openDocUrl(info.url, codec_name, tempfileSet); | ||
189 | if (info.cursor.isValid()) { | 189 | if (info.cursor.isValid()) { | ||
190 | setCursor(info.cursor.line(), info.cursor.column()); | 190 | setCursor(info.cursor.line(), info.cursor.column()); | ||
191 | } | 191 | } | ||
192 | else if (info.url.hasQuery()) { | ||||
193 | QUrlQuery q(info.url); | ||||
194 | QString lineStr = q.queryItemValue(QStringLiteral("line")); | ||||
195 | QString columnStr = q.queryItemValue(QStringLiteral("column")); | ||||
196 | | ||||
197 | int line = lineStr.toInt(); | ||||
dhaumann: Please make line and column an int. It's an int in KWrite handing as well. | |||||
198 | if (line > 0) | ||||
199 | line--; | ||||
200 | | ||||
201 | int column = columnStr.toInt(); | ||||
202 | if (column > 0) | ||||
203 | column--; | ||||
204 | | ||||
205 | setCursor(line, column); | ||||
206 | } | ||||
192 | } else { | 207 | } else { | ||
193 | KMessageBox::sorry(activeKateMainWindow(), | 208 | KMessageBox::sorry(activeKateMainWindow(), | ||
194 | i18n("The file '%1' could not be opened: it is not a normal file, it is a folder.", info.url.toString())); | 209 | i18n("The file '%1' could not be opened: it is not a normal file, it is a folder.", info.url.toString())); | ||
195 | } | 210 | } | ||
196 | } | 211 | } | ||
197 | 212 | | |||
198 | // handle stdin input | 213 | // handle stdin input | ||
199 | if (m_args.isSet(QStringLiteral("stdin"))) { | 214 | if (m_args.isSet(QStringLiteral("stdin"))) { | ||
▲ Show 20 Lines • Show All 281 Lines • Show Last 20 Lines |
Please make line and column an int. It's an int in KWrite handing as well.