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

Method KDiff3App

src/kdiff3.cpp:115–373  ·  view source on GitHub ↗

Don't call completeInit from here it will be called in KDiff3Shell as needed. */

Source from the content-addressed store, hash-verified

113 Don't call completeInit from here it will be called in KDiff3Shell as needed.
114*/
115KDiff3App::KDiff3App(QWidget* pParent, const QString& name, KDiff3Shell* pKDiff3Shell, const FileNames& names):
116 QMainWindow(pParent)
117{
118 setWindowFlags(Qt::Widget);
119 setObjectName(name);
120 m_pKDiff3Shell = pKDiff3Shell;
121
122 //Get SourceData objects intalized as soon as possiable or wierd errors can happen on startup.
123 if(!names.fn1.isEmpty())
124 {
125 m_sd1->setFilename(names.fn1);
126 m_bDirCompare = m_sd1->isDir();
127 }
128 if(!names.fn2.isEmpty())
129 {
130 m_sd2->setFilename(names.fn2);
131 }
132 if(!names.fn3.isEmpty())
133 {
134 m_sd3->setFilename(names.fn3);
135 }
136
137 m_pCentralWidget = new QWidget(this);
138 QVBoxLayout* pCentralLayout = new QVBoxLayout(m_pCentralWidget);
139 pCentralLayout->setContentsMargins(0, 0, 0, 0);
140 pCentralLayout->setSpacing(0);
141 setCentralWidget(m_pCentralWidget);
142
143 m_pMainWidget = new QWidget(m_pCentralWidget);
144 m_pMainWidget->setObjectName("MainWidget");
145 pCentralLayout->addWidget(m_pMainWidget);
146 m_pMainWidget->hide();
147
148 setWindowTitle("KDiff3");
149 setUpdatesEnabled(false);
150
151 // set Disabled to same color as enabled to prevent flicker in DirectoryMergeWindow
152 QPalette pal;
153 pal.setBrush(QPalette::Base, pal.brush(QPalette::Active, QPalette::Base));
154 pal.setColor(QPalette::Text, pal.color(QPalette::Active, QPalette::Text));
155 setPalette(pal);
156
157 // Setup progress ProgressDialog. No progress can be shown before this point.
158 // ProgressProxy will otherwise emit no-ops to disconnected boost signals.
159 if(g_pProgressDialog == nullptr)
160 {
161 g_pProgressDialog = new ProgressDialog(this, statusBar());
162 g_pProgressDialog->setStayHidden(true);
163 }
164
165 // All default values must be set before calling readOptions().
166 m_pOptionDialog = new OptionDialog(m_pKDiff3Shell != nullptr, this);
167 chk_connect_a(m_pOptionDialog, &OptionDialog::applyDone, this, &KDiff3App::slotRefresh);
168
169 m_pOptionDialog->readOptions(KSharedConfig::openConfig());
170
171 // Option handling.
172 qsizetype argCount = KDiff3Shell::getParser()->optionNames().count() + KDiff3Shell::getParser()->positionalArguments().count();

Callers

nothing calls this directly

Calls 15

QTextStreamClass · 0.85
setFilenameMethod · 0.80
hideMethod · 0.80
setStayHiddenMethod · 0.80
readOptionsMethod · 0.80
calcOptionHelpMethod · 0.80
parseOptionsMethod · 0.80
setTextMethod · 0.80
valueMethod · 0.80
setAliasNameMethod · 0.80
endMethod · 0.80

Tested by

no test coverage detected