Option to display history in reverse order#150
Open
mhtvsSFrpHdE wants to merge 4 commits intopvanek:masterfrom
Open
Option to display history in reverse order#150mhtvsSFrpHdE wants to merge 4 commits intopvanek:masterfrom
mhtvsSFrpHdE wants to merge 4 commits intopvanek:masterfrom
Conversation
When click OK to save Qlipper Preferences, program will crash in debug mode, but runs fine in release mode. This commit is questionable and could break release mode behavior. The commit author have no desire to do further investigation.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Look at "Unsolved concern" section, there's a change may break current stable release.
close #149
QXT
NO_QXTThis code come with no Qxt library.
So every code wrapped inside
#ifndefwill compile and run.System tray menu data
qlippersystemtray.cppQlipperModel::clearHistory()is atqlippermodel.cpp.When clearing history, a sample clipboard item will created like this:
History is stored in
m_dynamic, andbeginInsertRowsseems to be able to decide where to insert a clipboard item.System tray menu interface
qlippersystemtray.cppThere is
m_shortcutMenu = new QMenuView();, and related code to bind events.m_shortcutMenu->setModel(m_model);tells the menu where to get data.m_modelis created bym_model = new QlipperModel(this);How the data goes in system tray menu
qlippermodel.cppThere are two types of data in system tray menu,
one is
m_stickyand another ism_dynamic.m_dynamicis the list that stores copied data,m_sticky can be ignored right now.
The program is hard coded to put data on top of the list by use
m_dynamic.prepend(item);, to reverse the order, change this code tom_sticky.append(item);When it come to interface
In QCreator, double click to open
qlipperpreferencesdialog.uiso "Check box" could be dragged from "Design" tab into setting interface.
UI is layout based, multiple checkbox could stay inside same line,
if thier width is smaller than certain amout.
Otherwise, force two wide checkbox into same line,
setting window width will increase.
Get interface value in code
"qlipperpreferences.h"
There is "bool clearItemsOnExit() const;",
write similar code aside to get user interface value.
Typically a checkbox definiation looks like:
To use the function, call from other place:
Old data
qlippermodel.cppWhen copy content same as exist value, it will picked from data list,
and put to top of the menu, then do font bold.
By doing test, I should put this data to end of the menu,
change bold position from
sticky_count + 1to end of the menu.The variable to determine a font is bold or not seems to be
m_currentIndex.The code to move data to top seems to be
The code use erase to remove range of element at once instead of one by one.
At the beginning, I guess this ensure that all old data will be deleted in signle event.
But later the code use
-1to determine how many data to be removed.I should update exist code to use ranged remove,
but exist behavior is stable, best not to touch it.
Normal order:
Reverse order:
Move data
qlippermodel.cppThe code with reverse order:
However, Qt API
beginMoveRowsseems to have a index start from 0,but the above code send
countas parameter instead ofcount - 1.If I use
count - 1,endMoveRows()will crash the program.I must assume that this code is based on
countand have code hack in somewhere else.Bold it
qlippermodel.cppLook all references to
m_currentIndex, one of them located atThis code not need to update.
To update it use
reverseOrder:Unsolved concern
Debug mode save setting crash
An unknwon exception will crash the program when the code runs to
This crash only happens in Debug mode but not Release mode.
A quick fix to avoid this suggested by code AI: