Skip to content

Commit 740fdef

Browse files
committed
kconfig: qconf: remove name from ConfigSearchWindow constructor
This constructor is only called with "search" as the second argument. Hard-code the name in the constructor, and drop it from the function argument. Signed-off-by: Masahiro Yamada <[email protected]>
1 parent 1b4263e commit 740fdef

File tree

2 files changed

+22
-24
lines changed

2 files changed

+22
-24
lines changed

scripts/kconfig/qconf.cc

Lines changed: 21 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1288,10 +1288,10 @@ void ConfigInfoView::contextMenuEvent(QContextMenuEvent *e)
12881288
Parent::contextMenuEvent(e);
12891289
}
12901290

1291-
ConfigSearchWindow::ConfigSearchWindow(ConfigMainWindow* parent, const char *name)
1291+
ConfigSearchWindow::ConfigSearchWindow(ConfigMainWindow *parent)
12921292
: Parent(parent), result(NULL)
12931293
{
1294-
setObjectName(name);
1294+
setObjectName("search");
12951295
setWindowTitle("Search Config");
12961296

12971297
QVBoxLayout* layout1 = new QVBoxLayout(this);
@@ -1312,35 +1312,33 @@ ConfigSearchWindow::ConfigSearchWindow(ConfigMainWindow* parent, const char *nam
13121312

13131313
split = new QSplitter(this);
13141314
split->setOrientation(Qt::Vertical);
1315-
list = new ConfigView(split, name);
1315+
list = new ConfigView(split, "search");
13161316
list->list->mode = listMode;
1317-
info = new ConfigInfoView(split, name);
1317+
info = new ConfigInfoView(split, "search");
13181318
connect(list->list, SIGNAL(menuChanged(struct menu *)),
13191319
info, SLOT(setInfo(struct menu *)));
13201320
connect(list->list, SIGNAL(menuChanged(struct menu *)),
13211321
parent, SLOT(setMenuLink(struct menu *)));
13221322

13231323
layout1->addWidget(split);
13241324

1325-
if (name) {
1326-
QVariant x, y;
1327-
int width, height;
1328-
bool ok;
1325+
QVariant x, y;
1326+
int width, height;
1327+
bool ok;
13291328

1330-
configSettings->beginGroup(name);
1331-
width = configSettings->value("/window width", parent->width() / 2).toInt();
1332-
height = configSettings->value("/window height", parent->height() / 2).toInt();
1333-
resize(width, height);
1334-
x = configSettings->value("/window x");
1335-
y = configSettings->value("/window y");
1336-
if ((x.isValid())&&(y.isValid()))
1337-
move(x.toInt(), y.toInt());
1338-
QList<int> sizes = configSettings->readSizes("/split", &ok);
1339-
if (ok)
1340-
split->setSizes(sizes);
1341-
configSettings->endGroup();
1342-
connect(configApp, SIGNAL(aboutToQuit()), SLOT(saveSettings()));
1343-
}
1329+
configSettings->beginGroup("search");
1330+
width = configSettings->value("/window width", parent->width() / 2).toInt();
1331+
height = configSettings->value("/window height", parent->height() / 2).toInt();
1332+
resize(width, height);
1333+
x = configSettings->value("/window x");
1334+
y = configSettings->value("/window y");
1335+
if (x.isValid() && y.isValid())
1336+
move(x.toInt(), y.toInt());
1337+
QList<int> sizes = configSettings->readSizes("/split", &ok);
1338+
if (ok)
1339+
split->setSizes(sizes);
1340+
configSettings->endGroup();
1341+
connect(configApp, SIGNAL(aboutToQuit()), SLOT(saveSettings()));
13441342
}
13451343

13461344
void ConfigSearchWindow::saveSettings(void)
@@ -1642,7 +1640,7 @@ void ConfigMainWindow::saveConfigAs(void)
16421640
void ConfigMainWindow::searchConfig(void)
16431641
{
16441642
if (!searchWindow)
1645-
searchWindow = new ConfigSearchWindow(this, "search");
1643+
searchWindow = new ConfigSearchWindow(this);
16461644
searchWindow->show();
16471645
}
16481646

scripts/kconfig/qconf.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ class ConfigSearchWindow : public QDialog {
272272
Q_OBJECT
273273
typedef class QDialog Parent;
274274
public:
275-
ConfigSearchWindow(ConfigMainWindow* parent, const char *name = 0);
275+
ConfigSearchWindow(ConfigMainWindow *parent);
276276

277277
public slots:
278278
void saveSettings(void);

0 commit comments

Comments
 (0)