-
Notifications
You must be signed in to change notification settings - Fork 16
Sort sessions by date in Launcher #278
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
apps/Launcher/FolderModel.cpp
Outdated
} | ||
|
||
auto stringList = _toQStringList(years); | ||
if (_sortOrder == SortOrder::Descending) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
already use std::greater
in set constructor to sort reversed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh that's a good idea, I hadn't thought about that! Unfortunately it seems that the comparator is part of the type and thus cannot (easily) be selected at runtime:
https://stackoverflow.com/questions/11185223
What I could do to avoid an additional sorting operation is to conditionally use set.rbegin(), set.rend() in _toQStringList(). Not sure if that has a good impact on code readability, though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the conditional set.rbegin(), set.rend() in _toQStringList() looks quite good in the end, done!
apps/Launcher/FolderModel.cpp
Outdated
@@ -154,6 +206,15 @@ void FolderModel::setSortOrder(FolderModel::SortOrder sortOrder) | |||
emit sortOrderChanged(sortOrder); | |||
} | |||
|
|||
void FolderModel::setHideExtensions(bool hideExtensions) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const bool
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
return 0; | ||
case FolderModel::SortCategory::Size: | ||
case SortCategory::Size: | ||
return 1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what happened to 2
? Just out of curiosity
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It corresponds to the filePath I think and it's not exposed as a sorting option by the model.
/* provided with the distribution. */ | ||
/* */ | ||
/* THIS SOFTWARE IS PROVIDED BY THE UNIVERSITY OF TEXAS AT */ | ||
/* AUSTIN ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the TACC stuff is actually still valid for new files?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm proabably not, I just keep copying the same disclaimer everywhere. We use "Ecole polytechnique federale de Lausanne" at the end of it so it's not even consistent. Since we are the ones providing the software now a batch change of all files would be a good idea, keeping only the "Copyright (c) 2011-2012, The University of Texas at Austin" where applicable (at the top of old files).
else | ||
foldersModel.sortCategory = FolderModel.Name | ||
|
||
console.log(parent.active, foldersModel.sortCategory) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
logging intended?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No that was a debug print, good catch
@@ -33,6 +33,7 @@ var fileBrowserDiscreteTextColor = "#B0B0B0" | |||
var fileBrowserBlinkColor = "lightblue" | |||
var fileBrowserItemSizeRel = 0.2 | |||
var fileBrowserTextSizeRelToItem = 0.09 | |||
var fileBrowserGridSectionTextRelSize = 0.35 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there were more new numbers used, but don't know which ones make sense to put here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I try to add the most important numbers here but it's cumbersome to do it for every single value (such as a 2x or 0.5) so it's true that I don't do it when it's a very localized style issue. Sometimes it is also easier to look directly in the qml to change minor style details rather than having to check if a constant is used in multiple places...
Ignore all the duplicated comments in the mail, I deleted them here. Apparently they were saved somewhere from yesterday, but I didn't see them. Oh well... |
first commit updated |
No description provided.