Changeset View
Changeset View
Standalone View
Standalone View
src/kmainwindow.cpp
Show First 20 Lines • Show All 432 Lines • ▼ Show 20 Line(s) | 427 | { | |||
---|---|---|---|---|---|
433 | } | 433 | } | ||
434 | 434 | | |||
435 | return d->helpMenu->menu(); | 435 | return d->helpMenu->menu(); | ||
436 | } | 436 | } | ||
437 | #endif | 437 | #endif | ||
438 | 438 | | |||
439 | bool KMainWindow::canBeRestored(int number) | 439 | bool KMainWindow::canBeRestored(int number) | ||
440 | { | 440 | { | ||
441 | if (!qApp->isSessionRestored()) { | | |||
442 | return false; | | |||
443 | } | | |||
444 | KConfig *config = KConfigGui::sessionConfig(); | 441 | KConfig *config = KConfigGui::sessionConfig(); | ||
445 | if (!config) { | 442 | if (!config) { | ||
446 | return false; | 443 | return false; | ||
447 | } | 444 | } | ||
448 | 445 | | |||
449 | KConfigGroup group(config, "Number"); | 446 | KConfigGroup group(config, "Number"); | ||
450 | const int n = group.readEntry("NumberOfWindows", 1); | 447 | const int n = group.readEntry("NumberOfWindows", 1); | ||
451 | return number >= 1 && number <= n; | 448 | return number >= 1 && number <= n; | ||
452 | } | 449 | } | ||
453 | 450 | | |||
454 | const QString KMainWindow::classNameOfToplevel(int number) | 451 | const QString KMainWindow::classNameOfToplevel(int number) | ||
455 | { | 452 | { | ||
456 | if (!qApp->isSessionRestored()) { | | |||
457 | return QString(); | | |||
458 | } | | |||
459 | KConfig *config = KConfigGui::sessionConfig(); | 453 | KConfig *config = KConfigGui::sessionConfig(); | ||
460 | if (!config) { | 454 | if (!config) { | ||
461 | return QString(); | 455 | return QString(); | ||
462 | } | 456 | } | ||
463 | 457 | | |||
464 | KConfigGroup group(config, QByteArray(WINDOW_PROPERTIES).append(QByteArray::number(number)).constData()); | 458 | KConfigGroup group(config, QByteArray(WINDOW_PROPERTIES).append(QByteArray::number(number)).constData()); | ||
465 | if (!group.hasKey("ClassName")) { | 459 | if (!group.hasKey("ClassName")) { | ||
466 | return QString(); | 460 | return QString(); | ||
▲ Show 20 Lines • Show All 475 Lines • Show Last 20 Lines |