Permalink
Browse files

Fixed: showing library directory; Added: sample photos

  • Loading branch information...
1 parent b090233 commit 198dca6d69753952d66715eab9026d736965cdcf @jjkrol committed Jun 3, 2012
View
@@ -56,15 +56,17 @@ Glib::RefPtr<Gtk::TreeStore> CoreController::getDirectoryTree(){
//filling tree
Gtk::TreeModel::Row row;
+ Gtk::TreeModel::Row temp_row;
for(vector<path>::iterator it = paths.begin(); it != paths.end(); ++it) {
path temp_path = it->parent_path();
if(temp_path == library_path.parent_path()) {
- //ommit the main directory
- }
- else if(temp_path.parent_path() == library_path.parent_path()){
row = *(database_tree->append());
- row[dir_columns.name] = it->parent_path().filename().string(); //adding label
+ row[dir_columns.name] = "/"; //adding label
}
+// else if(temp_path.parent_path() == library_path.parent_path()){
+// temp_row = *(database_tree->append(row.children()));
+// temp_row[dir_columns.name] = it->parent_path().filename().string(); //adding label
+// }
else{
vector<path> temp_paths;
//go to library path
@@ -73,15 +75,14 @@ Glib::RefPtr<Gtk::TreeStore> CoreController::getDirectoryTree(){
temp_path = temp_path.parent_path();
}
//descend
- Gtk::TreeModel::Row temp_row;
bool alreadyInserted = false;
//check first
path popped_path = temp_paths.back();
temp_paths.pop_back();
Gtk::TreeModel::Children::iterator ch_it;
- Gtk::TreeModel::Children children = database_tree->children();
+ Gtk::TreeModel::Children children = row.children();
for(ch_it = children.begin(); ch_it != children.end(); ++ch_it){
if((*ch_it)[dir_columns.name] == popped_path.string()){
alreadyInserted = true;
@@ -92,7 +93,7 @@ Glib::RefPtr<Gtk::TreeStore> CoreController::getDirectoryTree(){
temp_row = *ch_it;
}
else{
- temp_row = *(database_tree->append());
+ temp_row = *(database_tree->append(row.children()));
temp_row[dir_columns.name] = popped_path.string(); //adding label
}
View
@@ -29,7 +29,10 @@ vector <Directory*> Directory::getSubdirectories(){
//create a vector of pointers to Directory Objects
for(vector<path>::iterator it = subdirFilenames.begin(); it!=subdirFilenames.end(); it++){
path subdirPath = directoryPath;
- subdirectories.push_back(new Directory(subdirPath/=path("/")/=(*it)));
+ if(directoryPath.string() == "/")
+ subdirectories.push_back(new Directory(subdirPath/=(*it)));
+ else
+ subdirectories.push_back(new Directory(subdirPath/=path("/")/=(*it)));
}
return subdirectories;
@@ -55,7 +58,10 @@ vector<Photo*> Directory::getPhotos(){
//create vector of pointers to Photo objects
for(vector<path>::iterator it = photoFilenames.begin(); it!=photoFilenames.end(); it++){
path photoPath = directoryPath;
- photos.push_back(Photo::getInstance(photoPath/=path("/")/=(*it)));
+ if(directoryPath.string() == "/")
+ photos.push_back(Photo::getInstance(photoPath/=(*it)));
+ else
+ photos.push_back(Photo::getInstance(photoPath/=path("/")/=(*it)));
}
return photos;
@@ -0,0 +1,4 @@
+[Dolphin]
+ShowPreview=true
+Timestamp=2012,6,3,10,53,38
+Version=2
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@@ -0,0 +1,4 @@
+[Dolphin]
+ShowPreview=true
+Timestamp=2012,6,3,10,53,38
+Version=2
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 198dca6

Please sign in to comment.