Several files astylized.
This commit is contained in:
@@ -27,17 +27,17 @@
|
||||
using namespace rtengine;
|
||||
using namespace rtengine::procparams;
|
||||
|
||||
ProfileStoreLabel::ProfileStoreLabel(const ProfileStoreEntry *entry) : Gtk::Label(entry->label), entry(entry)
|
||||
ProfileStoreLabel::ProfileStoreLabel (const ProfileStoreEntry *entry) : Gtk::Label (entry->label), entry (entry)
|
||||
{
|
||||
set_alignment(0, 0.5);
|
||||
set_ellipsize(Pango::ELLIPSIZE_END);
|
||||
set_alignment (0, 0.5);
|
||||
set_ellipsize (Pango::ELLIPSIZE_END);
|
||||
show();
|
||||
}
|
||||
|
||||
ProfileStoreComboBox::ProfileStoreComboBox ()
|
||||
{
|
||||
updateProfileList();
|
||||
setPreferredWidth(50, 120);
|
||||
setPreferredWidth (50, 120);
|
||||
}
|
||||
|
||||
Glib::ustring ProfileStoreComboBox::getCurrentLabel()
|
||||
@@ -71,16 +71,16 @@ void ProfileStoreComboBox::refreshProfileList_ (Gtk::TreeModel::Row *parentRow,
|
||||
for (auto entry : *entryList) {
|
||||
if (entry->parentFolderId == parentFolderId) { // filtering the entry of the same folder
|
||||
if (entry->type == PSET_FOLDER) {
|
||||
Glib::ustring folderPath( ProfileStore::getInstance()->getPathFromId(entry->folderId) );
|
||||
Glib::ustring folderPath ( ProfileStore::getInstance()->getPathFromId (entry->folderId) );
|
||||
|
||||
if (options.useBundledProfiles || ((folderPath != "${G}" ) && (folderPath != "${U}" ))) {
|
||||
// creating the new submenu
|
||||
Gtk::TreeModel::Row newSubMenu;
|
||||
|
||||
if (initial) {
|
||||
newSubMenu = *(refTreeModel->append());
|
||||
newSubMenu = * (refTreeModel->append());
|
||||
} else {
|
||||
newSubMenu = *(refTreeModel->append(parentRow->children()));
|
||||
newSubMenu = * (refTreeModel->append (parentRow->children()));
|
||||
}
|
||||
|
||||
// creating and assigning the custom Label object
|
||||
@@ -88,7 +88,7 @@ void ProfileStoreComboBox::refreshProfileList_ (Gtk::TreeModel::Row *parentRow,
|
||||
newSubMenu[methodColumns.profileStoreEntry] = entry;
|
||||
#if GTK_MAJOR_VERSION == 3 && GTK_MINOR_VERSION == 18
|
||||
// HACK: Workaround for bug in Gtk+ 3.18...
|
||||
Gtk::TreeModel::Row menuHeader = *(refTreeModel->append(newSubMenu->children()));
|
||||
Gtk::TreeModel::Row menuHeader = * (refTreeModel->append (newSubMenu->children()));
|
||||
menuHeader[methodColumns.label] = "-";
|
||||
menuHeader[methodColumns.profileStoreEntry] = entry;
|
||||
#endif
|
||||
@@ -101,9 +101,9 @@ void ProfileStoreComboBox::refreshProfileList_ (Gtk::TreeModel::Row *parentRow,
|
||||
|
||||
// creating a menu entry
|
||||
if (initial) {
|
||||
newItem = *(refTreeModel->append());
|
||||
newItem = * (refTreeModel->append());
|
||||
} else {
|
||||
newItem = *(refTreeModel->append(parentRow->children()));
|
||||
newItem = * (refTreeModel->append (parentRow->children()));
|
||||
}
|
||||
|
||||
newItem[methodColumns.label] = entry->label;
|
||||
@@ -123,27 +123,27 @@ void ProfileStoreComboBox::updateProfileList ()
|
||||
clear();
|
||||
refTreeModel.clear();
|
||||
// Create the Tree model
|
||||
refTreeModel = Gtk::TreeStore::create(methodColumns);
|
||||
refTreeModel = Gtk::TreeStore::create (methodColumns);
|
||||
// Assign the model to the Combobox
|
||||
set_model(refTreeModel);
|
||||
set_model (refTreeModel);
|
||||
|
||||
// this will lock the profilestore's entry list too
|
||||
const std::vector<const ProfileStoreEntry*> *entryList = ProfileStore::getInstance()->getFileList();
|
||||
|
||||
//profileStore.dumpFolderList();
|
||||
refreshProfileList_ (NULL, entryList->at(0)->parentFolderId, true, entryList);
|
||||
refreshProfileList_ (NULL, entryList->at (0)->parentFolderId, true, entryList);
|
||||
|
||||
if (entryList->at(0)->parentFolderId != 0) {
|
||||
if (entryList->at (0)->parentFolderId != 0) {
|
||||
// special case for the Internal default entry
|
||||
addRow(ProfileStore::getInstance()->getInternalDefaultPSE());
|
||||
addRow (ProfileStore::getInstance()->getInternalDefaultPSE());
|
||||
}
|
||||
|
||||
// releasing the profilestore's entry list mutex
|
||||
ProfileStore::getInstance()->releaseFileList();
|
||||
|
||||
pack_start(methodColumns.label, false);
|
||||
pack_start (methodColumns.label, false);
|
||||
|
||||
Gtk::CellRendererText* cellRenderer = dynamic_cast<Gtk::CellRendererText*>(get_first_cell());
|
||||
Gtk::CellRendererText* cellRenderer = dynamic_cast<Gtk::CellRendererText*> (get_first_cell());
|
||||
cellRenderer->property_ellipsize() = Pango::ELLIPSIZE_MIDDLE;
|
||||
cellRenderer->property_ellipsize_set() = true;
|
||||
}
|
||||
@@ -153,7 +153,7 @@ Gtk::TreeIter ProfileStoreComboBox::findRowFromEntry_ (Gtk::TreeModel::Children
|
||||
Gtk::TreeModel::Row row;
|
||||
Gtk::TreeIter rowInSubLevel;
|
||||
|
||||
for(Gtk::TreeModel::Children::iterator iter = childs.begin(); iter != childs.end(); ++iter) {
|
||||
for (Gtk::TreeModel::Children::iterator iter = childs.begin(); iter != childs.end(); ++iter) {
|
||||
row = *iter;
|
||||
// Hombre: is there a smarter way of knowing if this row has childs?
|
||||
const ProfileStoreEntry *pse_ = row[methodColumns.profileStoreEntry];
|
||||
@@ -191,7 +191,7 @@ Gtk::TreeIter ProfileStoreComboBox::findRowFromFullPath_ (Gtk::TreeModel::Childr
|
||||
Gtk::TreeModel::Row row;
|
||||
Gtk::TreeIter rowInSubLevel;
|
||||
|
||||
for(Gtk::TreeModel::Children::iterator iter = childs.begin(); iter != childs.end(); ++iter) {
|
||||
for (Gtk::TreeModel::Children::iterator iter = childs.begin(); iter != childs.end(); ++iter) {
|
||||
row = *iter;
|
||||
// Hombre: is there a smarter way of knowing if this row has childs?
|
||||
const ProfileStoreEntry *pse = row[methodColumns.profileStoreEntry];
|
||||
@@ -222,27 +222,27 @@ Gtk::TreeIter ProfileStoreComboBox::findRowFromFullPath (Glib::ustring path)
|
||||
}
|
||||
|
||||
if (path == DEFPROFILE_INTERNAL) {
|
||||
row = findRowFromEntry(profileStore->getInternalDefaultPSE());
|
||||
row = findRowFromEntry (profileStore->getInternalDefaultPSE());
|
||||
return row;
|
||||
}
|
||||
|
||||
if (path == DEFPROFILE_DYNAMIC) {
|
||||
row = findRowFromEntry(profileStore->getInternalDynamicPSE());
|
||||
row = findRowFromEntry (profileStore->getInternalDynamicPSE());
|
||||
return row;
|
||||
}
|
||||
|
||||
// removing the filename
|
||||
Glib::ustring fName = Glib::path_get_basename(path);
|
||||
Glib::ustring fName = Glib::path_get_basename (path);
|
||||
|
||||
if (!fName.empty()) {
|
||||
path = path.substr(0, path.length() - fName.length());
|
||||
path = path.substr (0, path.length() - fName.length());
|
||||
} else {
|
||||
// path is malformed;
|
||||
return row;
|
||||
}
|
||||
|
||||
path = Glib::path_get_dirname(path);
|
||||
int parentFolderId = profileStore->findFolderId(path);
|
||||
path = Glib::path_get_dirname (path);
|
||||
int parentFolderId = profileStore->findFolderId (path);
|
||||
|
||||
// 1. find the path in the folder list
|
||||
if (parentFolderId != -1) {
|
||||
@@ -277,26 +277,26 @@ Glib::ustring ProfileStoreComboBox::getFullPathFromActiveRow()
|
||||
}
|
||||
|
||||
if (currEntry == profileStore->getInternalDefaultPSE()) {
|
||||
return Glib::ustring(DEFPROFILE_INTERNAL);
|
||||
return Glib::ustring (DEFPROFILE_INTERNAL);
|
||||
}
|
||||
|
||||
if (currEntry == profileStore->getInternalDynamicPSE()) {
|
||||
return Glib::ustring(DEFPROFILE_DYNAMIC);
|
||||
return Glib::ustring (DEFPROFILE_DYNAMIC);
|
||||
}
|
||||
|
||||
path = Glib::build_filename(profileStore->getPathFromId(currEntry->parentFolderId), currEntry->label);
|
||||
path = Glib::build_filename (profileStore->getPathFromId (currEntry->parentFolderId), currEntry->label);
|
||||
}
|
||||
|
||||
return path;
|
||||
}
|
||||
|
||||
bool ProfileStoreComboBox::setActiveRowFromFullPath(Glib::ustring path)
|
||||
bool ProfileStoreComboBox::setActiveRowFromFullPath (Glib::ustring path)
|
||||
{
|
||||
if (!path.empty()) {
|
||||
Gtk::TreeIter row = findRowFromFullPath(path);
|
||||
Gtk::TreeIter row = findRowFromFullPath (path);
|
||||
|
||||
if (row) {
|
||||
set_active(row);
|
||||
set_active (row);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -304,13 +304,13 @@ bool ProfileStoreComboBox::setActiveRowFromFullPath(Glib::ustring path)
|
||||
return false;
|
||||
}
|
||||
|
||||
bool ProfileStoreComboBox::setActiveRowFromEntry(const ProfileStoreEntry *pse)
|
||||
bool ProfileStoreComboBox::setActiveRowFromEntry (const ProfileStoreEntry *pse)
|
||||
{
|
||||
if (pse) {
|
||||
Gtk::TreeIter row = findRowFromEntry(pse);
|
||||
Gtk::TreeIter row = findRowFromEntry (pse);
|
||||
|
||||
if (row) {
|
||||
set_active(row);
|
||||
set_active (row);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -320,11 +320,11 @@ bool ProfileStoreComboBox::setActiveRowFromEntry(const ProfileStoreEntry *pse)
|
||||
|
||||
bool ProfileStoreComboBox::setInternalEntry ()
|
||||
{
|
||||
return setActiveRowFromEntry(ProfileStore::getInstance()->getInternalDefaultPSE());
|
||||
return setActiveRowFromEntry (ProfileStore::getInstance()->getInternalDefaultPSE());
|
||||
}
|
||||
|
||||
/** @brief Get the row from the first level of the tree that match the provided name */
|
||||
Gtk::TreeIter ProfileStoreComboBox::getRowFromLabel(Glib::ustring name)
|
||||
Gtk::TreeIter ProfileStoreComboBox::getRowFromLabel (Glib::ustring name)
|
||||
{
|
||||
Gtk::TreeIter row;
|
||||
Gtk::TreeModel::Children childs = refTreeModel->children();
|
||||
@@ -332,7 +332,7 @@ Gtk::TreeIter ProfileStoreComboBox::getRowFromLabel(Glib::ustring name)
|
||||
if (!name.empty()) {
|
||||
Gtk::TreeModel::Row currRow;
|
||||
|
||||
for(Gtk::TreeModel::Children::iterator iter = childs.begin(); iter != childs.end(); ++iter) {
|
||||
for (Gtk::TreeModel::Children::iterator iter = childs.begin(); iter != childs.end(); ++iter) {
|
||||
currRow = *iter;
|
||||
const ProfileStoreEntry *pse = currRow[methodColumns.profileStoreEntry];
|
||||
|
||||
@@ -347,7 +347,7 @@ Gtk::TreeIter ProfileStoreComboBox::getRowFromLabel(Glib::ustring name)
|
||||
}
|
||||
|
||||
/** @brief Add a new row to the first level of the tree */
|
||||
Gtk::TreeIter ProfileStoreComboBox::addRow(const ProfileStoreEntry *profileStoreEntry)
|
||||
Gtk::TreeIter ProfileStoreComboBox::addRow (const ProfileStoreEntry *profileStoreEntry)
|
||||
{
|
||||
Gtk::TreeIter newEntry = refTreeModel->append();
|
||||
Gtk::TreeModel::Row row = *newEntry;
|
||||
|
Reference in New Issue
Block a user