Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Utilities
Kate
Commits
ebff93e1
Commit
ebff93e1
authored
Mar 06, 2022
by
Christoph Cullmann
🍨
Browse files
show documents as loaded from config
BUG: 353373
parent
586c1708
Pipeline
#146537
passed with stage
in 3 minutes and 46 seconds
Changes
4
Pipelines
3
Hide whitespace changes
Inline
Side-by-side
kate/autotests/session_test.cpp
View file @
ebff93e1
...
...
@@ -97,18 +97,6 @@ void KateSessionTest::createFrom()
QCOMPARE
(
ns
->
config
()
->
group
(
groupName
).
readEntry
(
"foo"
),
QLatin1String
(
"bar"
));
}
void
KateSessionTest
::
documents
()
{
KateSession
::
Ptr
s
=
KateSession
::
create
(
m_tmpfile
->
fileName
(),
QStringLiteral
(
"session name"
));
s
->
setDocuments
(
42
);
QCOMPARE
((
int
)
s
->
documents
(),
42
);
s
->
config
()
->
sync
();
KConfig
c
(
m_tmpfile
->
fileName
());
QCOMPARE
(
c
.
group
(
"Open Documents"
).
readEntry
<
int
>
(
"Count"
,
0
),
42
);
}
void
KateSessionTest
::
setFile
()
{
KateSession
::
Ptr
s
=
KateSession
::
create
(
m_tmpfile
->
fileName
(),
QStringLiteral
(
"session name"
));
...
...
kate/autotests/session_test.h
View file @
ebff93e1
...
...
@@ -24,7 +24,6 @@ private Q_SLOTS:
void
createAnonymous
();
void
createAnonymousFrom
();
void
createFrom
();
void
documents
();
void
setFile
();
void
setName
();
void
timestamp
();
...
...
kate/session/katesession.cpp
View file @
ebff93e1
...
...
@@ -24,7 +24,6 @@ KateSession::KateSession(const QString &file, const QString &name, const bool an
:
m_name
(
name
)
,
m_file
(
file
)
,
m_anonymous
(
anonymous
)
,
m_documents
(
0
)
{
Q_ASSERT
(
!
m_file
.
isEmpty
());
...
...
@@ -36,9 +35,6 @@ KateSession::KateSession(const QString &file, const QString &name, const bool an
}
m_timestamp
=
QFileInfo
(
m_file
).
lastModified
();
// get the document count
m_documents
=
config
()
->
group
(
opGroupName
).
readEntry
(
keyCount
,
0
);
}
const
QString
&
KateSession
::
file
()
const
...
...
@@ -46,10 +42,9 @@ const QString &KateSession::file() const
return
m_file
;
}
void
KateSession
::
setD
ocuments
(
const
unsigned
int
number
)
unsigned
int
KateSession
::
d
ocuments
()
{
config
()
->
group
(
opGroupName
).
writeEntry
(
keyCount
,
number
);
m_documents
=
number
;
return
config
()
->
group
(
opGroupName
).
readEntry
(
keyCount
,
0
);
}
void
KateSession
::
setFile
(
const
QString
&
filename
)
...
...
kate/session/katesession.h
View file @
ebff93e1
...
...
@@ -51,15 +51,7 @@ public:
* count of documents in this session
* @return documents count
*/
unsigned
int
documents
()
const
{
return
m_documents
;
}
/**
* update \p number of opened documents in session
*/
void
setDocuments
(
const
unsigned
int
number
);
unsigned
int
documents
();
/**
* @return true if this is anonymous/new session
...
...
@@ -120,7 +112,6 @@ private:
QString
m_name
;
QString
m_file
;
bool
m_anonymous
;
unsigned
int
m_documents
;
std
::
unique_ptr
<
KConfig
>
m_config
;
QDateTime
m_timestamp
;
};
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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