Bug 319397 - Sessions > Quick Open Session should be disabled if there are no saved Kate sessions
Summary: Sessions > Quick Open Session should be disabled if there are no saved Kate s...
Status: RESOLVED FIXED
Alias: None
Product: kate
Classification: Unclassified
Component: sessions (show other bugs)
Version: 3.10.2
Platform: Ubuntu Packages Linux
: NOR normal (vote)
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-05-06 06:34 UTC by Shriramana Sharma
Modified: 2014-01-05 17:46 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In: 4.13


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Shriramana Sharma 2013-05-06 06:34:39 UTC
Steps to reproduce:
Open Kate in a user profile without any saved Kate sessions.
Open Sessions menu.

Observed:
Quick Open Session is enabled. 

Aggravating factors:
Clicking on it doesn't show any empty submenu. However, after clicking on it or pressing RightArrow when it is highlighted, if we try to go down by pressing DownArrow, nothing happens i.e. the highlight doesn't move down to the next menu item. Apparently there is some pseudo invisible submenu opened and so control does not rest with the current menu.

Desired:
If there are no saved sessions, Quick Open Session should be enabled. 

Rationale:
If there are no saved sessions, this menu item has no meaning and should be disabled. This will also remove the additional aggravations listed above.
Comment 1 Michal Humpula 2014-01-04 13:11:43 UTC
Git commit 96164b9450b494c6cfd3db52796a1befd2b747d1 by Michal Humpula.
Committed on 02/01/2014 at 22:09.
Pushed by michalhumpula into branch 'frameworks'.

break down the katession.h/.cpp files

Changes:

One class per file. Code is now testable (almost) independently from
the app, so adding bunch of unit tests.

KateSession
 * simple container
 * remove read/writeConfig() in favour of config()
 * move rename method to manager
 * decouple name from filename (manager does the coupling now)
 * hide constructor in favour of factories returning KateSession::Ptr
 * not dependent on KateSessionManager anymore
 * add sorting functions
 * add timestamp (last time the session was saved)

KateSessionManager
 * add activeSession(QString, bool, bool, bool)
 * add activeAnonymousSession()
 * change internal storage from QList to QHash (faster lookups)
 * remove sorting from sessionList() to callers
 * use KDirWatch to monitor session dir (this removes the constant
   updates of m_sessions)

KateSessionsAction
 * add possibility to depency-inject the KateSessionManager
 * sort by modification time (desc)
 * limit to ten items
 * disable action, when there are no sessions

KateSessionChooser
 * guarantee that selectedSession() will be valid, when result is resultOpen or
   resultCopy. This simplifies the KateSessionManager workflow.
Related: bug 139009
FIXED-IN: 5.0

M  +4    -0    autotests/CMakeLists.txt
A  +21   -0    autotests/kate/CMakeLists.txt
A  +169  -0    autotests/kate/session_manager_test.cpp     [License: LGPL (v2)]
A  +53   -0    autotests/kate/session_manager_test.h     [License: LGPL (v2)]
A  +150  -0    autotests/kate/session_test.cpp     [License: LGPL (v2)]
A  +48   -0    autotests/kate/session_test.h     [License: LGPL (v2)]
A  +99   -0    autotests/kate/sessions_action_test.cpp     [License: LGPL (v2)]
A  +46   -0    autotests/kate/sessions_action_test.h     [License: LGPL (v2)]
M  +18   -1    kate/app/CMakeLists.txt
M  +7    -7    kate/app/kateapp.cpp
M  +3    -2    kate/app/kateapp.h
M  +3    -5    kate/app/kateappadaptor.cpp
M  +2    -2    kate/app/kateconfigdialog.cpp
M  +6    -4    kate/app/katemainwindow.cpp
D  +0    -1059 kate/app/katesession.cpp
D  +0    -446  kate/app/katesession.h
M  +3    -3    kate/app/kateviewspace.cpp
A  +129  -0    kate/app/session/katesession.cpp     [License: LGPL (v2)]
A  +127  -0    kate/app/session/katesession.h     [License: LGPL (v2)]
A  +165  -0    kate/app/session/katesessionchooser.cpp     [License: LGPL (v2)]
A  +69   -0    kate/app/session/katesessionchooser.h     [License: LGPL (v2)]
A  +43   -0    kate/app/session/katesessionchooseritem.h     [License: LGPL (v2)]
A  +180  -0    kate/app/session/katesessionmanagedialog.cpp     [License: LGPL (v2)]
A  +77   -0    kate/app/session/katesessionmanagedialog.h     [License: LGPL (v2)]
A  +519  -0    kate/app/session/katesessionmanager.cpp     [License: LGPL (v2)]
A  +210  -0    kate/app/session/katesessionmanager.h     [License: LGPL (v2)]
A  +115  -0    kate/app/session/katesessionopendialog.cpp     [License: LGPL (v2)]
A  +61   -0    kate/app/session/katesessionopendialog.h     [License: LGPL (v2)]
A  +74   -0    kate/app/session/katesessionsaction.cpp     [License: LGPL (v2)]
A  +50   -0    kate/app/session/katesessionsaction.h     [License: LGPL (v2)]

http://commits.kde.org/kate/96164b9450b494c6cfd3db52796a1befd2b747d1
Comment 2 Michal Humpula 2014-01-05 17:46:16 UTC
Git commit 73a09cf44aef3e0f5fd0314fdc58fcda9c1933cf by Michal Humpula.
Committed on 31/12/2013 at 21:49.
Pushed by michalhumpula into branch 'master'.

disable quick session menu if there is no session

REVIEW: 114769
FIXED-IN: 4.13

M  +8    -0    kate/app/katesession.cpp
M  +1    -0    kate/app/katesession.h

http://commits.kde.org/kate/73a09cf44aef3e0f5fd0314fdc58fcda9c1933cf