|
a/src/qtgui/restable.cpp |
|
b/src/qtgui/restable.cpp |
|
... |
|
... |
43 |
#include "guiutils.h"
|
43 |
#include "guiutils.h"
|
44 |
#include "reslistpager.h"
|
44 |
#include "reslistpager.h"
|
45 |
#include "reslist.h"
|
45 |
#include "reslist.h"
|
46 |
#include "rclconfig.h"
|
46 |
#include "rclconfig.h"
|
47 |
#include "plaintorich.h"
|
47 |
#include "plaintorich.h"
|
|
|
48 |
#include "indexer.h"
|
48 |
|
49 |
|
49 |
// Compensate for the default and somewhat bizarre vertical placement
|
50 |
// Compensate for the default and somewhat bizarre vertical placement
|
50 |
// of text in cells
|
51 |
// of text in cells
|
51 |
static const int ROWHEIGHTPAD = 2;
|
52 |
static const int ROWHEIGHTPAD = 2;
|
52 |
static const int TEXTINCELLVTRANS = -4;
|
53 |
static const int TEXTINCELLVTRANS = -4;
|
|
... |
|
... |
75 |
: ResListPager(1), m_parent(p)
|
76 |
: ResListPager(1), m_parent(p)
|
76 |
{}
|
77 |
{}
|
77 |
virtual bool append(const string& data, int idx, const Rcl::Doc& doc);
|
78 |
virtual bool append(const string& data, int idx, const Rcl::Doc& doc);
|
78 |
virtual string trans(const string& in);
|
79 |
virtual string trans(const string& in);
|
79 |
virtual const string &parFormat();
|
80 |
virtual const string &parFormat();
|
80 |
virtual string iconPath(const string& mt);
|
|
|
81 |
virtual string absSep() {return (const char *)(prefs.abssep.toUtf8());}
|
81 |
virtual string absSep() {return (const char *)(prefs.abssep.toUtf8());}
|
|
|
82 |
virtual string iconUrl(RclConfig *, Rcl::Doc& doc);
|
82 |
private:
|
83 |
private:
|
83 |
ResTable *m_parent;
|
84 |
ResTable *m_parent;
|
84 |
};
|
85 |
};
|
85 |
|
86 |
|
86 |
bool ResTablePager::append(const string& data, int, const Rcl::Doc&)
|
87 |
bool ResTablePager::append(const string& data, int, const Rcl::Doc&)
|
|
... |
|
... |
100 |
const string& ResTablePager::parFormat()
|
101 |
const string& ResTablePager::parFormat()
|
101 |
{
|
102 |
{
|
102 |
return prefs.creslistformat;
|
103 |
return prefs.creslistformat;
|
103 |
}
|
104 |
}
|
104 |
|
105 |
|
105 |
string ResTablePager::iconPath(const string& mtype)
|
106 |
string ResTablePager::iconUrl(RclConfig *config, Rcl::Doc& doc)
|
106 |
{
|
107 |
{
|
|
|
108 |
if (doc.ipath.empty()) {
|
|
|
109 |
vector<Rcl::Doc> docs;
|
|
|
110 |
docs.push_back(doc);
|
|
|
111 |
vector<string> paths;
|
|
|
112 |
ConfIndexer::docsToPaths(docs, paths);
|
|
|
113 |
if (!paths.empty()) {
|
107 |
string iconpath;
|
114 |
string path;
|
108 |
theconfig->getMimeIconName(mtype, &iconpath);
|
115 |
if (thumbPathForUrl(cstr_fileu + paths[0], 128, path)) {
|
109 |
return iconpath;
|
116 |
return cstr_fileu + path;
|
|
|
117 |
}
|
|
|
118 |
}
|
|
|
119 |
}
|
|
|
120 |
return ResListPager::iconUrl(config, doc);
|
110 |
}
|
121 |
}
|
111 |
|
122 |
|
112 |
/////////////////////////////////////////////////////////////////////////////
|
123 |
/////////////////////////////////////////////////////////////////////////////
|
113 |
/// Detail text area methods
|
124 |
/// Detail text area methods
|
114 |
|
125 |
|