Changeset View
Changeset View
Standalone View
Standalone View
kwrite/main.cpp
Context not available. | |||||
19 | */ | 19 | */ | ||
---|---|---|---|---|---|
20 | 20 | | |||
21 | #include "kwrite.h" | 21 | #include "kwrite.h" | ||
22 | #include "kwriteapplication.h" | ||||
22 | 23 | | |||
23 | #include <ktexteditor/document.h> | 24 | #include <ktexteditor/document.h> | ||
24 | #include <ktexteditor/view.h> | 25 | #include <ktexteditor/view.h> | ||
Context not available. | |||||
194 | */ | 195 | */ | ||
195 | aboutData.processCommandLine(&parser); | 196 | aboutData.processCommandLine(&parser); | ||
196 | 197 | | |||
198 | KWriteApplication kapp; | ||||
199 | | ||||
197 | if (app.isSessionRestored()) { | 200 | if (app.isSessionRestored()) { | ||
198 | KWrite::restore(); | 201 | kapp.restore(); | ||
199 | } else { | 202 | } else { | ||
200 | bool nav = false; | 203 | bool nav = false; | ||
201 | int line = 0, column = 0; | 204 | int line = 0, column = 0; | ||
Context not available. | |||||
213 | } | 216 | } | ||
214 | 217 | | |||
215 | if (parser.positionalArguments().count() == 0) { | 218 | if (parser.positionalArguments().count() == 0) { | ||
216 | KWrite *t = new KWrite; | 219 | KWrite *t = kapp.newWindow(); | ||
217 | 220 | | |||
218 | if (parser.isSet(QStringLiteral("stdin"))) { | 221 | if (parser.isSet(QStringLiteral("stdin"))) { | ||
219 | QTextStream input(stdin, QIODevice::ReadOnly); | 222 | QTextStream input(stdin, QIODevice::ReadOnly); | ||
Context not available. | |||||
257 | 260 | | |||
258 | if (noDir) { | 261 | if (noDir) { | ||
259 | ++docs_opened; | 262 | ++docs_opened; | ||
260 | KWrite *t = new KWrite(); | 263 | KWrite *t = kapp.newWindow(); | ||
261 | 264 | | |||
262 | if (codec) { | 265 | if (codec) { | ||
263 | t->view()->document()->setEncoding(QString::fromLatin1(codec->name())); | 266 | t->view()->document()->setEncoding(QString::fromLatin1(codec->name())); | ||
Context not available. | |||||
295 | 298 | | |||
296 | // no window there, uh, ohh, for example borked session config !!! | 299 | // no window there, uh, ohh, for example borked session config !!! | ||
297 | // create at least one !! | 300 | // create at least one !! | ||
298 | if (KWrite::noWindows()) { | 301 | if (kapp.noWindows()) { | ||
299 | new KWrite(); | 302 | kapp.newWindow(); | ||
300 | } | 303 | } | ||
301 | 304 | | |||
302 | /** | 305 | /** | ||
Context not available. |