~ubuntu-branches/ubuntu/vivid/fbreader/vivid-proposed

« back to all changes in this revision

Viewing changes to fbreader/src/fbreader/FBFileHandler.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Joey Hess
  • Date: 2008-01-23 16:51:07 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20080123165107-5q19etahzd72c33a
Tags: 0.8.12-3
* Add libzlui-maemo which allows using fbreader on the maemo platform, on
  Debian. Thanks, Riku Voipio. Closes: #462299
* makefiles/arch/maemo.mk: Don't build with -thumb. (Riku)
* Loosen dependency versions some more, so it only depends on the current
  upstream version or higher, ignoring the Debian revision.
* Use binary:Version instead of deprecated Source-Version.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
 
 * FBReader -- electronic book reader
3
 
 * Copyright (C) 2004-2007 Nikolay Pultsin <geometer@mawhrin.net>
4
 
 * Copyright (C) 2005 Mikhail Sobolev <mss@mawhrin.net>
 
2
 * Copyright (C) 2004-2008 Geometer Plus <contact@geometerplus.com>
5
3
 *
6
4
 * This program is free software; you can redistribute it and/or modify
7
5
 * it under the terms of the GNU General Public License as published by
31
29
#include "../formats/FormatPlugin.h"
32
30
 
33
31
FBFileHandler::FBFileHandler() :
34
 
        DirectoryOption(ZLOption::LOOK_AND_FEEL_CATEGORY, "OpenFileDialog", "Directory", ZLApplication::HomeDirectory), myIsUpToDate(false), mySelectedIndex(0) {
 
32
        DirectoryOption(ZLCategoryKey::LOOK_AND_FEEL, "OpenFileDialog", "Directory", "~"), myIsUpToDate(false), mySelectedIndex(0) {
35
33
        myDir = ZLFile(DirectoryOption.value()).directory();
36
34
        if (myDir.isNull()) {
37
 
                myDir = ZLFile(ZLApplication::HomeDirectory).directory();
 
35
                myDir = ZLFile("~").directory();
38
36
        }
39
37
        if (myDir.isNull()) {
40
38
                myDir = ZLDir::root();
73
71
}
74
72
 
75
73
const std::vector<ZLTreeNodePtr> &FBFileHandler::subnodes() const {
 
74
        static const std::string UpFolderIcon = "upfolder";
76
75
        static const std::string FolderIcon = "folder";
77
76
        static const std::string ZipFolderIcon = "zipfolder";
78
77
        static std::map<FormatPlugin*,std::string> PluginIcons;
79
78
 
80
79
        if (!myIsUpToDate) {
81
80
                if (!myDir->isRoot()) {
82
 
                        mySubnodes.push_back(new ZLTreeNode("..", "..", FolderIcon, true));
 
81
                        mySubnodes.push_back(new ZLTreeNode("..", "..", UpFolderIcon, true));
83
82
                }
84
83
 
85
84
                std::map<std::string,ZLTreeNodePtr> folderNodes;