Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Unmaintained
KDE Pim
Commits
6481152f
Commit
6481152f
authored
Nov 16, 2014
by
Laurent Montel
😁
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove duplicate code
parent
e54fd2e1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
13 deletions
+12
-13
messagelist/pane.cpp
messagelist/pane.cpp
+11
-11
messagelist/pane.h
messagelist/pane.h
+1
-2
No files found.
messagelist/pane.cpp
View file @
6481152f
...
@@ -1061,8 +1061,8 @@ void Pane::readConfig(bool restoreSession)
...
@@ -1061,8 +1061,8 @@ void Pane::readConfig(bool restoreSession)
createNewTab
();
createNewTab
();
}
else
{
}
else
{
for
(
int
i
=
0
;
i
<
numberOfTab
;
++
i
)
{
for
(
int
i
=
0
;
i
<
numberOfTab
;
++
i
)
{
KConfigGroup
grp
(
MessageList
::
Core
::
Settings
::
self
()
->
config
(),
QString
::
fromLatin1
(
"MessageListTab%1"
).
arg
(
i
)
)
;
restoreHeaderSettings
(
i
);
QItemSelectionModel
*
selectionModel
=
createNewTab
();
createNewTab
();
#if 0
#if 0
Akonadi::Collection::Id id = grp.readEntry(QLatin1String("collectionId"),-1);
Akonadi::Collection::Id id = grp.readEntry(QLatin1String("collectionId"),-1);
ETMViewStateSaver *saver = new ETMViewStateSaver;
ETMViewStateSaver *saver = new ETMViewStateSaver;
...
@@ -1075,24 +1075,24 @@ void Pane::readConfig(bool restoreSession)
...
@@ -1075,24 +1075,24 @@ void Pane::readConfig(bool restoreSession)
saver->selectCollections(Akonadi::Collection::List()<<Akonadi::Collection(id));
saver->selectCollections(Akonadi::Collection::List()<<Akonadi::Collection(id));
saver->restoreCurrentItem( QString::fromLatin1("c%1").arg(id) );
saver->restoreCurrentItem( QString::fromLatin1("c%1").arg(id) );
}
}
#else
Q_UNUSED
(
selectionModel
);
#endif
#endif
Widget
*
w
=
qobject_cast
<
Widget
*>
(
widget
(
i
)
);
w
->
view
()
->
header
()
->
restoreState
(
grp
.
readEntry
(
QLatin1String
(
"HeaderState"
),
QByteArray
()));
}
}
setCurrentIndex
(
conf
.
readEntry
(
QLatin1String
(
"currentIndex"
),
0
));
setCurrentIndex
(
conf
.
readEntry
(
QLatin1String
(
"currentIndex"
),
0
));
}
}
}
else
{
}
else
{
createNewTab
();
createNewTab
();
KConfigGroup
grp
(
MessageList
::
Core
::
Settings
::
self
()
->
config
(),
QString
::
fromLatin1
(
"MessageListTab%1"
).
arg
(
0
));
restoreHeaderSettings
(
0
);
if
(
grp
.
exists
())
{
Widget
*
w
=
qobject_cast
<
Widget
*>
(
widget
(
0
)
);
w
->
view
()
->
header
()
->
restoreState
(
grp
.
readEntry
(
QLatin1String
(
"HeaderState"
),
QByteArray
()));
}
}
}
}
}
void
Pane
::
restoreHeaderSettings
(
int
index
)
{
KConfigGroup
grp
(
MessageList
::
Core
::
Settings
::
self
()
->
config
(),
QString
::
fromLatin1
(
"MessageListTab%1"
).
arg
(
index
));
if
(
grp
.
exists
())
{
Widget
*
w
=
qobject_cast
<
Widget
*>
(
widget
(
index
)
);
w
->
view
()
->
header
()
->
restoreState
(
grp
.
readEntry
(
QLatin1String
(
"HeaderState"
),
QByteArray
()));
}
}
bool
Pane
::
searchEditHasFocus
()
const
bool
Pane
::
searchEditHasFocus
()
const
{
{
...
...
messagelist/pane.h
View file @
6481152f
...
@@ -457,8 +457,7 @@ signals:
...
@@ -457,8 +457,7 @@ signals:
private:
private:
void
restoreHeaderSettings
(
int
index
);
void
readConfig
(
bool
restoreSession
);
void
readConfig
(
bool
restoreSession
);
Q_PRIVATE_SLOT
(
d
,
void
onSelectionChanged
(
const
QItemSelection
&
,
const
QItemSelection
&
))
Q_PRIVATE_SLOT
(
d
,
void
onSelectionChanged
(
const
QItemSelection
&
,
const
QItemSelection
&
))
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment