MCPcopy Create free account
hub / github.com/KDE/kdiff3 / showMainWindow

Method showMainWindow

src/kdiff3.cpp:573–601  ·  view source on GitHub ↗

Restore and show mainWindow.

Source from the content-addressed store, hash-verified

571
572// Restore and show mainWindow.
573void KDiff3App::showMainWindow()
574{
575 if(!m_pKDiff3Shell->isVisible() && !restoreWindow(KSharedConfig::openConfig()))
576 {
577 /*
578 Set default state/geometry from config file.
579 This will no longer be updated but serves as a fallback.
580 Qt's restoreState/saveState can handle multiple screens this won't.
581 */
582 if(gOptions->isFullScreen())
583 m_pKDiff3Shell->showFullScreen();
584 else if(gOptions->isMaximized())
585 m_pKDiff3Shell->showMaximized();
586
587 QSize size = gOptions->getGeometry();
588 QPoint pos = gOptions->getPosition();
589
590 if(!size.isEmpty())
591 {
592 m_pKDiff3Shell->resize(size);
593
594 QRect visibleRect = QRect(pos, size) & m_pKDiff3Shell->screen()->availableGeometry();
595 if(visibleRect.width() > 100 && visibleRect.height() > 100)
596 m_pKDiff3Shell->move(pos);
597 }
598 }
599
600 m_pKDiff3Shell->show();
601}
602
603// Do file comparision.
604void KDiff3App::doFileCompare()

Callers

nothing calls this directly

Calls 5

isFullScreenMethod · 0.80
isMaximizedMethod · 0.80
widthMethod · 0.80
showMethod · 0.80
isEmptyMethod · 0.45

Tested by

no test coverage detected