|
a/src/qtgui/viewaction_w.cpp |
|
b/src/qtgui/viewaction_w.cpp |
|
... |
|
... |
86 |
stringToStrings(s, viewerXs);
|
86 |
stringToStrings(s, viewerXs);
|
87 |
}
|
87 |
}
|
88 |
for (vector<pair<string, string> >::const_iterator it = defs.begin();
|
88 |
for (vector<pair<string, string> >::const_iterator it = defs.begin();
|
89 |
it != defs.end(); it++) {
|
89 |
it != defs.end(); it++) {
|
90 |
actionsLV->setItem(row, 0,
|
90 |
actionsLV->setItem(row, 0,
|
91 |
new QTableWidgetItem(QString::fromAscii(it->first.c_str())));
|
91 |
new QTableWidgetItem(QString::fromUtf8(it->first.c_str())));
|
92 |
if (!prefs.useDesktopOpen ||
|
92 |
if (!prefs.useDesktopOpen ||
|
93 |
viewerXs.find(it->first) != viewerXs.end()) {
|
93 |
viewerXs.find(it->first) != viewerXs.end()) {
|
94 |
actionsLV->setItem(
|
94 |
actionsLV->setItem(
|
95 |
row, 1,
|
95 |
row, 1,
|
96 |
new QTableWidgetItem(QString::fromAscii(it->second.c_str())));
|
96 |
new QTableWidgetItem(QString::fromUtf8(it->second.c_str())));
|
97 |
} else {
|
97 |
} else {
|
98 |
actionsLV->setItem(
|
98 |
actionsLV->setItem(
|
99 |
row, 1, new QTableWidgetItem(tr("Desktop Default")));
|
99 |
row, 1, new QTableWidgetItem(tr("Desktop Default")));
|
100 |
}
|
100 |
}
|
101 |
row++;
|
101 |
row++;
|
|
... |
|
... |
117 |
}
|
117 |
}
|
118 |
}
|
118 |
}
|
119 |
|
119 |
|
120 |
void ViewAction::onSelSameClicked()
|
120 |
void ViewAction::onSelSameClicked()
|
121 |
{
|
121 |
{
|
122 |
fprintf(stderr, "onSelSameClicked()\n");
|
|
|
123 |
actionsLV->clearSelection();
|
122 |
actionsLV->clearSelection();
|
124 |
QString value = currentLBL->text();
|
123 |
QString value = currentLBL->text();
|
125 |
if (value.isEmpty())
|
124 |
if (value.isEmpty())
|
126 |
return;
|
125 |
return;
|
127 |
string action = qs2utf8s(value);
|
126 |
string action = qs2utf8s(value);
|
|
... |
|
... |
129 |
vector<pair<string, string> > defs;
|
128 |
vector<pair<string, string> > defs;
|
130 |
theconfig->getMimeViewerDefs(defs);
|
129 |
theconfig->getMimeViewerDefs(defs);
|
131 |
for (unsigned int i = 0; i < defs.size(); i++) {
|
130 |
for (unsigned int i = 0; i < defs.size(); i++) {
|
132 |
if (defs[i].second == action) {
|
131 |
if (defs[i].second == action) {
|
133 |
QList<QTableWidgetItem *>items =
|
132 |
QList<QTableWidgetItem *>items =
|
134 |
actionsLV->findItems(QString::fromAscii(defs[i].first.c_str()),
|
133 |
actionsLV->findItems(QString::fromUtf8(defs[i].first.c_str()),
|
135 |
Qt::MatchFixedString|Qt::MatchCaseSensitive);
|
134 |
Qt::MatchFixedString|Qt::MatchCaseSensitive);
|
136 |
for (QList<QTableWidgetItem *>::iterator it = items.begin();
|
135 |
for (QList<QTableWidgetItem *>::iterator it = items.begin();
|
137 |
it != items.end(); it++) {
|
136 |
it != items.end(); it++) {
|
138 |
(*it)->setSelected(true);
|
137 |
(*it)->setSelected(true);
|
139 |
QTableWidgetItem *item1 = actionsLV->item((*it)->row(), 1);
|
138 |
QTableWidgetItem *item1 = actionsLV->item((*it)->row(), 1);
|
|
... |
|
... |
151 |
|
150 |
|
152 |
vector<pair<string, string> > defs;
|
151 |
vector<pair<string, string> > defs;
|
153 |
theconfig->getMimeViewerDefs(defs);
|
152 |
theconfig->getMimeViewerDefs(defs);
|
154 |
for (unsigned int i = 0; i < defs.size(); i++) {
|
153 |
for (unsigned int i = 0; i < defs.size(); i++) {
|
155 |
if (defs[i].first == mtype) {
|
154 |
if (defs[i].first == mtype) {
|
156 |
currentLBL->setText(QString::fromAscii(defs[i].second.c_str()));
|
155 |
currentLBL->setText(QString::fromUtf8(defs[i].second.c_str()));
|
157 |
selSamePB->setEnabled(true);
|
156 |
selSamePB->setEnabled(true);
|
158 |
return;
|
157 |
return;
|
159 |
}
|
158 |
}
|
160 |
}
|
159 |
}
|
161 |
currentLBL->clear();
|
160 |
currentLBL->clear();
|