┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPeter Penz <[email protected]>2007-12-04 21:05:41 +0000
committerPeter Penz <[email protected]>2007-12-04 21:05:41 +0000
commit525fdd8afc1468dc72e6a150cf75dee4c330bdcd (patch)
tree9a2777eca76ee4a29f6522574042f3fee460c175 /src
parent569033022089a8e2a025b4899df9051172dd36c7 (diff)
SVN_SILENT coding style fixes
svn path=/trunk/KDE/kdebase/apps/; revision=744903
Diffstat (limited to 'src')
-rw-r--r--src/dolphinmodel.cpp28
-rw-r--r--src/dolphinview.cpp7
-rw-r--r--src/dolphinview.h2
3 files changed, 21 insertions, 16 deletions
diff --git a/src/dolphinmodel.cpp b/src/dolphinmodel.cpp
index d56890251..e74df4d3f 100644
--- a/src/dolphinmodel.cpp
+++ b/src/dolphinmodel.cpp
@@ -85,31 +85,35 @@ QVariant DolphinModel::data(const QModelIndex &index, int role) const
if (!item.isHidden() && name.at(0).isLetter())
retString = name.at(0).toUpper();
else if (item.isHidden()) {
- if(name.at(0) == '.') {
- if(name.size() > 1 && name.at(1).isLetter())
+ if (name.at(0) == '.') {
+ if (name.size() > 1 && name.at(1).isLetter()) {
retString = name.at(1).toUpper();
- else
+ } else {
retString = i18nc("@title:group Name", "Others");
- } else
+ }
+ } else {
retString = name.at(0).toUpper();
+ }
} else {
bool validCategory = false;
const QString str(name.toUpper());
const QChar* currA = str.unicode();
while (!currA->isNull() && !validCategory) {
- if (currA->isLetter())
+ if (currA->isLetter()) {
validCategory = true;
- else if (currA->isDigit())
+ } else if (currA->isDigit()) {
return i18nc("@title:group", "Others");
- else
+ } else {
++currA;
+ }
}
- if (!validCategory)
- retString = i18nc("@title:group Name", "Others");
- else
+ if (!validCategory) {
+ retString = validCategory ? *currA : i18nc("@title:group Name", "Others");
+ } else {
retString = *currA;
+ }
}
}
break;
@@ -214,9 +218,9 @@ QVariant DolphinModel::data(const QModelIndex &index, int role) const
case DolphinModel::Tags: {
retString = tagsForIndex(index);
- if (retString.isEmpty())
+ if (retString.isEmpty()) {
retString = i18nc("@title:group Tags", "Not yet tagged");
-
+ }
break;
}
#endif
diff --git a/src/dolphinview.cpp b/src/dolphinview.cpp
index 41bee6972..0b8fe5883 100644
--- a/src/dolphinview.cpp
+++ b/src/dolphinview.cpp
@@ -861,10 +861,11 @@ void DolphinView::createView()
view->setItemDelegate(m_fileItemDelegate);
view->setModel(m_proxyModel);
- if(m_selectionModel)
- view->setSelectionModel(m_selectionModel);
- else
+ if (m_selectionModel != 0) {
+ view->setSelectionModel(m_selectionModel);
+ } else {
m_selectionModel = view->selectionModel();
+ }
m_selectionModel->setParent(this); //Reparent the selection model. We do not want it to be deleted when we delete the model
diff --git a/src/dolphinview.h b/src/dolphinview.h
index 4a2f5be02..508862e9c 100644
--- a/src/dolphinview.h
+++ b/src/dolphinview.h
@@ -690,7 +690,7 @@ private:
DolphinDetailsView* m_detailsView;
DolphinColumnView* m_columnView;
KFileItemDelegate* m_fileItemDelegate;
- QItemSelectionModel *m_selectionModel;
+ QItemSelectionModel* m_selectionModel;
DolphinModel* m_dolphinModel;
KDirLister* m_dirLister;