Skip to content

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

Merged
merged 2 commits into from
Oct 23, 2018
Merged

Sort sessions by date in Launcher #278

merged 2 commits into from
Oct 23, 2018

Conversation

rdumusc
Copy link

@rdumusc rdumusc commented Oct 18, 2018

No description provided.

}

auto stringList = _toQStringList(years);
if (_sortOrder == SortOrder::Descending)
Copy link
Contributor

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?

Copy link
Author

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.

Copy link
Author

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!

@@ -154,6 +206,15 @@ void FolderModel::setSortOrder(FolderModel::SortOrder sortOrder)
emit sortOrderChanged(sortOrder);
}

void FolderModel::setHideExtensions(bool hideExtensions)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

const bool

Copy link
Author

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;
Copy link
Contributor

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

Copy link
Author

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, */
Copy link
Contributor

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?

Copy link
Author

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)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

logging intended?

Copy link
Author

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
Copy link
Contributor

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.

Copy link
Author

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...

@dnachbaur
Copy link
Contributor

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...

@rdumusc
Copy link
Author

rdumusc commented Oct 23, 2018

first commit updated

@rdumusc rdumusc merged commit d46682f into BlueBrain:master Oct 23, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants