summaryrefslogtreecommitdiffstats
path: root/src/dolphindetailsview.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-04-27 00:40:29 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-04-27 00:40:29 +0000
commit7a741e43ff09e70396a918956219b8316c48e522 (patch)
tree3d0f60eccd59786cea7236db2d5c4c1f25874515 /src/dolphindetailsview.cpp
parenta48487ef0c329434b58b6f920111bb0999f1109e (diff)
downloaddolphin-7a741e43ff09e70396a918956219b8316c48e522.tar.gz
dolphin-7a741e43ff09e70396a918956219b8316c48e522.zip
TQt4 port Dolphin
This enables compilation under Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/dolphin@1229359 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'src/dolphindetailsview.cpp')
-rw-r--r--src/dolphindetailsview.cpp288
1 files changed, 144 insertions, 144 deletions
diff --git a/src/dolphindetailsview.cpp b/src/dolphindetailsview.cpp
index 66d524e..df23295 100644
--- a/src/dolphindetailsview.cpp
+++ b/src/dolphindetailsview.cpp
@@ -21,16 +21,16 @@
#include "dolphindetailsview.h"
#include <kurldrag.h>
-#include <qpainter.h>
-#include <qobjectlist.h>
-#include <qheader.h>
-#include <qclipboard.h>
-#include <qpainter.h>
+#include <tqpainter.h>
+#include <tqobjectlist.h>
+#include <tqheader.h>
+#include <tqclipboard.h>
+#include <tqpainter.h>
#include <klocale.h>
#include <kglobalsettings.h>
-#include <qscrollbar.h>
-#include <qcursor.h>
-#include <qstyle.h>
+#include <tqscrollbar.h>
+#include <tqcursor.h>
+#include <tqstyle.h>
#include <assert.h>
#include "dolphinview.h"
@@ -41,55 +41,55 @@
#include "dolphinstatusbar.h"
#include "dolphindetailsviewsettings.h"
-DolphinDetailsView::DolphinDetailsView(DolphinView* parent) :
- KFileDetailView(parent, 0),
- m_dolphinView(parent),
+DolphinDetailsView::DolphinDetailsView(DolphinView* tqparent) :
+ KFileDetailView(tqparent, 0),
+ m_dolphinView(tqparent),
m_resizeTimer(0),
m_scrollTimer(0),
m_rubber(0)
{
- m_resizeTimer = new QTimer(this);
- connect(m_resizeTimer, SIGNAL(timeout()),
- this, SLOT(updateColumnsWidth()));
+ m_resizeTimer = new TQTimer(this);
+ connect(m_resizeTimer, TQT_SIGNAL(timeout()),
+ this, TQT_SLOT(updateColumnsWidth()));
setAcceptDrops(true);
setSelectionMode(KFile::Extended);
- setHScrollBarMode(QScrollView::AlwaysOff);
+ setHScrollBarMode(TQScrollView::AlwaysOff);
- setColumnAlignment(SizeColumn, Qt::AlignRight);
+ setColumnAlignment(SizeColumn, TQt::AlignRight);
for (int i = DateColumn; i <= GroupColumn; ++i) {
- setColumnAlignment(i, Qt::AlignHCenter);
+ setColumnAlignment(i, TQt::AlignHCenter);
}
Dolphin& dolphin = Dolphin::mainWin();
- connect(this, SIGNAL(onItem(QListViewItem*)),
- this, SLOT(slotOnItem(QListViewItem*)));
- connect(this, SIGNAL(onViewport()),
- this, SLOT(slotOnViewport()));
- connect(this, SIGNAL(contextMenuRequested(QListViewItem*, const QPoint&, int)),
- this, SLOT(slotContextMenuRequested(QListViewItem*, const QPoint&, int)));
- connect(this, SIGNAL(selectionChanged()),
- &dolphin, SLOT(slotSelectionChanged()));
- connect(&dolphin, SIGNAL(activeViewChanged()),
- this, SLOT(slotActivationUpdate()));
- connect(this, SIGNAL(itemRenamed(QListViewItem*, const QString&, int)),
- this, SLOT(slotItemRenamed(QListViewItem*, const QString&, int)));
- connect(this, SIGNAL(dropped(QDropEvent*, const KURL::List&, const KURL&)),
- parent, SLOT(slotURLListDropped(QDropEvent*, const KURL::List&, const KURL&)));
-
- QClipboard* clipboard = QApplication::clipboard();
- connect(clipboard, SIGNAL(dataChanged()),
- this, SLOT(slotUpdateDisabledItems()));
-
- QHeader* viewHeader = header();
+ connect(this, TQT_SIGNAL(onItem(TQListViewItem*)),
+ this, TQT_SLOT(slotOnItem(TQListViewItem*)));
+ connect(this, TQT_SIGNAL(onViewport()),
+ this, TQT_SLOT(slotOnViewport()));
+ connect(this, TQT_SIGNAL(contextMenuRequested(TQListViewItem*, const TQPoint&, int)),
+ this, TQT_SLOT(slotContextMenuRequested(TQListViewItem*, const TQPoint&, int)));
+ connect(this, TQT_SIGNAL(selectionChanged()),
+ &dolphin, TQT_SLOT(slotSelectionChanged()));
+ connect(&dolphin, TQT_SIGNAL(activeViewChanged()),
+ this, TQT_SLOT(slotActivationUpdate()));
+ connect(this, TQT_SIGNAL(itemRenamed(TQListViewItem*, const TQString&, int)),
+ this, TQT_SLOT(slotItemRenamed(TQListViewItem*, const TQString&, int)));
+ connect(this, TQT_SIGNAL(dropped(TQDropEvent*, const KURL::List&, const KURL&)),
+ tqparent, TQT_SLOT(slotURLListDropped(TQDropEvent*, const KURL::List&, const KURL&)));
+
+ TQClipboard* clipboard = TQApplication::tqclipboard();
+ connect(clipboard, TQT_SIGNAL(dataChanged()),
+ this, TQT_SLOT(slotUpdateDisabledItems()));
+
+ TQHeader* viewHeader = header();
viewHeader->setResizeEnabled(false);
viewHeader->setMovingEnabled(false);
- connect(viewHeader, SIGNAL(clicked(int)),
- this, SLOT(slotHeaderClicked(int)));
+ connect(viewHeader, TQT_SIGNAL(clicked(int)),
+ this, TQT_SLOT(slotHeaderClicked(int)));
setMouseTracking(true);
- setDefaultRenameAction(QListView::Accept);
+ setDefaultRenameAction(TQListView::Accept);
refreshSettings();
}
@@ -117,7 +117,7 @@ void DolphinDetailsView::endItemUpdates()
}
int index = 0;
- const QValueList<URLNavigator::HistoryElem> history = m_dolphinView->urlHistory(index);
+ const TQValueList<URLNavigator::HistoryElem> history = m_dolphinView->urlHistory(index);
if (!history.isEmpty()) {
KFileView* fileView = static_cast<KFileView*>(this);
fileView->setCurrentItem(history[index].currentFileName());
@@ -131,15 +131,15 @@ void DolphinDetailsView::insertItem(KFileItem* fileItem)
{
KFileView::insertItem(fileItem);
- DolphinListViewItem* item = new DolphinListViewItem(static_cast<QListView*>(this), fileItem);
+ DolphinListViewItem* item = new DolphinListViewItem(static_cast<TQListView*>(this), fileItem);
- QDir::SortSpec spec = KFileView::sorting();
- if (spec & QDir::Time) {
+ TQDir::SortSpec spec = KFileView::sorting();
+ if (spec & TQDir::Time) {
item->setKey(sortingKey(fileItem->time(KIO::UDS_MODIFICATION_TIME),
fileItem->isDir(),
spec));
}
- else if (spec & QDir::Size) {
+ else if (spec & TQDir::Size) {
item->setKey(sortingKey(fileItem->size(), fileItem->isDir(), spec));
}
else {
@@ -149,9 +149,9 @@ void DolphinDetailsView::insertItem(KFileItem* fileItem)
fileItem->setExtraData(this, item);
}
-bool DolphinDetailsView::isOnFilename(const QListViewItem* item, const QPoint& pos) const
+bool DolphinDetailsView::isOnFilename(const TQListViewItem* item, const TQPoint& pos) const
{
- const QPoint absPos(mapToGlobal(QPoint(0, 0)));
+ const TQPoint absPos(mapToGlobal(TQPoint(0, 0)));
return (pos.x() - absPos.x()) <= filenameWidth(item);
}
@@ -166,7 +166,7 @@ void DolphinDetailsView::refreshSettings()
}
}
- QFont adjustedFont(font());
+ TQFont adjustedFont(font());
adjustedFont.setFamily(settings->fontFamily());
adjustedFont.setPointSize(settings->fontSize());
setFont(adjustedFont);
@@ -224,9 +224,9 @@ void DolphinDetailsView::resizeContents(int width, int height)
m_resizeTimer->start(50, true);
}
-void DolphinDetailsView::slotOnItem(QListViewItem* item)
+void DolphinDetailsView::slotOnItem(TQListViewItem* item)
{
- if (isOnFilename(item, QCursor::pos())) {
+ if (isOnFilename(item, TQCursor::pos())) {
activateItem(item);
KFileItem* fileItem = static_cast<KFileListViewItem*>(item)->fileInfo();
m_dolphinView->requestItemInfo(fileItem->url());
@@ -243,12 +243,12 @@ void DolphinDetailsView::slotOnViewport()
}
void DolphinDetailsView::setContextPixmap(void* context,
- const QPixmap& pixmap)
+ const TQPixmap& pixmap)
{
reinterpret_cast<KFileListViewItem*>(context)->setPixmap(0, pixmap);
}
-const QPixmap* DolphinDetailsView::contextPixmap(void* context)
+const TQPixmap* DolphinDetailsView::contextPixmap(void* context)
{
return reinterpret_cast<KFileListViewItem*>(context)->pixmap(0);
}
@@ -270,7 +270,7 @@ KFileItem* DolphinDetailsView::contextFileInfo(void* context)
}
-void DolphinDetailsView::contentsDragMoveEvent(QDragMoveEvent* event)
+void DolphinDetailsView::contentsDragMoveEvent(TQDragMoveEvent* event)
{
KFileDetailView::contentsDragMoveEvent(event);
@@ -292,7 +292,7 @@ void DolphinDetailsView::contentsDragMoveEvent(QDragMoveEvent* event)
}
}
-void DolphinDetailsView::resizeEvent(QResizeEvent* event)
+void DolphinDetailsView::resizeEvent(TQResizeEvent* event)
{
KFileDetailView::resizeEvent(event);
@@ -304,14 +304,14 @@ void DolphinDetailsView::resizeEvent(QResizeEvent* event)
m_resizeTimer->start(50, true);
}
-bool DolphinDetailsView::acceptDrag(QDropEvent* event) const
+bool DolphinDetailsView::acceptDrag(TQDropEvent* event) const
{
bool accept = KURLDrag::canDecode(event) &&
- (event->action() == QDropEvent::Copy ||
- event->action() == QDropEvent::Move ||
- event->action() == QDropEvent::Link);
+ (event->action() == TQDropEvent::Copy ||
+ event->action() == TQDropEvent::Move ||
+ event->action() == TQDropEvent::Link);
if (accept) {
- if (static_cast<const QWidget*>(event->source()) == this) {
+ if (static_cast<const TQWidget*>(event->source()) == this) {
KFileListViewItem* item = static_cast<KFileListViewItem*>(itemAt(event->pos()));
accept = (item != 0);
if (accept) {
@@ -324,15 +324,15 @@ bool DolphinDetailsView::acceptDrag(QDropEvent* event) const
return accept;
}
-void DolphinDetailsView::contentsDropEvent(QDropEvent* event)
+void DolphinDetailsView::contentsDropEvent(TQDropEvent* event)
{
// KFileDetailView::contentsDropEvent does not care whether the mouse
// cursor is above a filename or not, the destination URL is always
// the URL of the item. This is fixed here in a way that the destination
// URL is only the URL of the item if the cursor is above the filename.
- const QPoint pos(QCursor::pos());
- const QPoint viewportPos(viewport()->mapToGlobal(QPoint(0, 0)));
- QListViewItem* item = itemAt(QPoint(pos.x() - viewportPos.x(), pos.y() - viewportPos.y()));
+ const TQPoint pos(TQCursor::pos());
+ const TQPoint viewportPos(viewport()->mapToGlobal(TQPoint(0, 0)));
+ TQListViewItem* item = itemAt(TQPoint(pos.x() - viewportPos.x(), pos.y() - viewportPos.y()));
if ((item == 0) || ((item != 0) && isOnFilename(item, pos))) {
// dropping is done on the viewport or directly above a filename
KFileDetailView::contentsDropEvent(event);
@@ -360,7 +360,7 @@ void DolphinDetailsView::contentsDropEvent(QDropEvent* event)
}
}
-void DolphinDetailsView::contentsMousePressEvent(QMouseEvent* event)
+void DolphinDetailsView::contentsMousePressEvent(TQMouseEvent* event)
{
if (m_rubber != 0) {
drawRubber();
@@ -372,9 +372,9 @@ void DolphinDetailsView::contentsMousePressEvent(QMouseEvent* event)
// if the mouse cursor is not above the filename. This prevents
// that the item gets selected and simulates an equal usability
// like in the icon view.
- const QPoint pos(QCursor::pos());
- const QPoint viewportPos(viewport()->mapToGlobal(QPoint(0, 0)));
- QListViewItem* item = itemAt(QPoint(pos.x() - viewportPos.x(), pos.y() - viewportPos.y()));
+ const TQPoint pos(TQCursor::pos());
+ const TQPoint viewportPos(viewport()->mapToGlobal(TQPoint(0, 0)));
+ TQListViewItem* item = itemAt(TQPoint(pos.x() - viewportPos.x(), pos.y() - viewportPos.y()));
if ((item != 0) && isOnFilename(item, pos)) {
KFileDetailView::contentsMousePressEvent(event);
}
@@ -387,7 +387,7 @@ void DolphinDetailsView::contentsMousePressEvent(QMouseEvent* event)
}
assert(m_rubber == 0);
- m_rubber = new QRect(event->x(), event->y(), 0, 0);
+ m_rubber = new TQRect(event->x(), event->y(), 0, 0);
}
resetActivatedItem();
@@ -396,7 +396,7 @@ void DolphinDetailsView::contentsMousePressEvent(QMouseEvent* event)
m_dolphinView->statusBar()->clear();
}
-void DolphinDetailsView::contentsMouseMoveEvent(QMouseEvent* event)
+void DolphinDetailsView::contentsMouseMoveEvent(TQMouseEvent* event)
{
if (m_rubber != 0) {
slotAutoScroll();
@@ -405,9 +405,9 @@ void DolphinDetailsView::contentsMouseMoveEvent(QMouseEvent* event)
KFileDetailView::contentsMouseMoveEvent(event);
- const QPoint& pos = event->globalPos();
- const QPoint viewportPos = viewport()->mapToGlobal(QPoint(0, 0));
- QListViewItem* item = itemAt(QPoint(pos.x() - viewportPos.x(), pos.y() - viewportPos.y()));
+ const TQPoint& pos = event->globalPos();
+ const TQPoint viewportPos = viewport()->mapToGlobal(TQPoint(0, 0));
+ TQListViewItem* item = itemAt(TQPoint(pos.x() - viewportPos.x(), pos.y() - viewportPos.y()));
if ((item != 0) && isOnFilename(item, pos)) {
activateItem(item);
}
@@ -416,7 +416,7 @@ void DolphinDetailsView::contentsMouseMoveEvent(QMouseEvent* event)
}
}
-void DolphinDetailsView::contentsMouseReleaseEvent(QMouseEvent* event)
+void DolphinDetailsView::contentsMouseReleaseEvent(TQMouseEvent* event)
{
if (m_rubber != 0) {
drawRubber();
@@ -425,8 +425,8 @@ void DolphinDetailsView::contentsMouseReleaseEvent(QMouseEvent* event)
}
if (m_scrollTimer != 0) {
- disconnect(m_scrollTimer, SIGNAL(timeout()),
- this, SLOT(slotAutoScroll()));
+ disconnect(m_scrollTimer, TQT_SIGNAL(timeout()),
+ this, TQT_SLOT(slotAutoScroll()));
m_scrollTimer->stop();
delete m_scrollTimer;
m_scrollTimer = 0;
@@ -435,13 +435,13 @@ void DolphinDetailsView::contentsMouseReleaseEvent(QMouseEvent* event)
KFileDetailView::contentsMouseReleaseEvent(event);
}
-void DolphinDetailsView::paintEmptyArea(QPainter* painter, const QRect& rect)
+void DolphinDetailsView::paintEmptyArea(TQPainter* painter, const TQRect& rect)
{
if (m_dolphinView->isActive()) {
KFileDetailView::paintEmptyArea(painter, rect);
}
else {
- const QBrush brush(colorGroup().background());
+ const TQBrush brush(tqcolorGroup().background());
painter->fillRect(rect, brush);
}
}
@@ -457,28 +457,28 @@ void DolphinDetailsView::drawRubber()
return;
}
- QPainter p;
+ TQPainter p;
p.begin(viewport());
p.setRasterOp(NotROP);
- p.setPen(QPen(color0, 1));
+ p.setPen(TQPen(color0, 1));
p.setBrush(NoBrush);
- QPoint point(m_rubber->x(), m_rubber->y());
+ TQPoint point(m_rubber->x(), m_rubber->y());
point = contentsToViewport(point);
- style().drawPrimitive(QStyle::PE_FocusRect, &p,
- QRect(point.x(), point.y(), m_rubber->width(), m_rubber->height()),
- colorGroup(), QStyle::Style_Default, colorGroup().base());
+ tqstyle().tqdrawPrimitive(TQStyle::PE_FocusRect, &p,
+ TQRect(point.x(), point.y(), m_rubber->width(), m_rubber->height()),
+ tqcolorGroup(), TQStyle::Style_Default, tqcolorGroup().base());
p.end();
}
-void DolphinDetailsView::viewportPaintEvent(QPaintEvent* paintEvent)
+void DolphinDetailsView::viewportPaintEvent(TQPaintEvent* paintEvent)
{
drawRubber();
KFileDetailView::viewportPaintEvent(paintEvent);
drawRubber();
}
-void DolphinDetailsView::leaveEvent(QEvent* event)
+void DolphinDetailsView::leaveEvent(TQEvent* event)
{
KFileDetailView::leaveEvent(event);
slotOnViewport();
@@ -489,25 +489,25 @@ void DolphinDetailsView::slotActivationUpdate()
update();
// TODO: there must be a simpler way to say
- // "update all children"
- const QObjectList* list = children();
- if (list == 0) {
+ // "update all tqchildren"
+ const TQObjectList list = childrenListObject();
+ if (list.isEmpty()) {
return;
}
- QObjectListIterator it(*list);
- QObject* object = 0;
+ TQObjectListIterator it(list);
+ TQObject* object = 0;
while ((object = it.current()) != 0) {
- if (object->inherits("QWidget")) {
- QWidget* widget = static_cast<QWidget*>(object);
+ if (object->inherits(TQWIDGET_OBJECT_NAME_STRING)) {
+ TQWidget* widget = TQT_TQWIDGET(object);
widget->update();
}
++it;
}
}
-void DolphinDetailsView::slotContextMenuRequested(QListViewItem* item,
- const QPoint& pos,
+void DolphinDetailsView::slotContextMenuRequested(TQListViewItem* item,
+ const TQPoint& pos,
int /* col */)
{
KFileItem* fileInfo = 0;
@@ -531,8 +531,8 @@ void DolphinDetailsView::slotAutoScroll()
// (Copyright (C) 1998, 1999 Torben Weis <weis@kde.org>
// 2001, 2002, 2004 Michael Brade <brade@kde.org>)
- const QPoint pos(viewport()->mapFromGlobal(QCursor::pos()));
- const QPoint vc(viewportToContents(pos));
+ const TQPoint pos(viewport()->mapFromGlobal(TQCursor::pos()));
+ const TQPoint vc(viewportToContents(pos));
if (vc == m_rubber->bottomRight()) {
return;
@@ -542,20 +542,20 @@ void DolphinDetailsView::slotAutoScroll()
m_rubber->setBottomRight(vc);
- QListViewItem* item = itemAt(QPoint(0,0));
+ TQListViewItem* item = itemAt(TQPoint(0,0));
const bool block = signalsBlocked();
blockSignals(true);
- const QRect rubber(m_rubber->normalize());
+ const TQRect rubber(m_rubber->normalize());
const int bottom = contentsY() + visibleHeight() - 1;
// select all items which intersect with the rubber, deselect all others
bool bottomReached = false;
while ((item != 0) && !bottomReached) {
- QRect rect(itemRect(item));
+ TQRect rect(tqitemRect(item));
rect.setWidth(filenameWidth(item));
- rect = QRect(viewportToContents(rect.topLeft()),
+ rect = TQRect(viewportToContents(rect.topLeft()),
viewportToContents(rect.bottomRight()));
if (rect.isValid() && (rect.top() <= bottom)) {
const KFileItem* fileItem = static_cast<KFileListViewItem*>(item)->fileInfo();
@@ -575,21 +575,21 @@ void DolphinDetailsView::slotAutoScroll()
// scroll the viewport if the top or bottom margin is reached
const int scrollMargin = 40;
ensureVisible(vc.x(), vc.y(), scrollMargin, scrollMargin);
- const bool scroll = !QRect(scrollMargin,
+ const bool scroll = !TQRect(scrollMargin,
scrollMargin,
viewport()->width() - 2 * scrollMargin,
- viewport()->height() - 2 * scrollMargin).contains(pos);
+ viewport()->height() - 2 * scrollMargin).tqcontains(pos);
if (scroll) {
if (m_scrollTimer == 0) {
- m_scrollTimer = new QTimer( this );
- connect(m_scrollTimer, SIGNAL(timeout()),
- this, SLOT(slotAutoScroll()));
+ m_scrollTimer = new TQTimer( this );
+ connect(m_scrollTimer, TQT_SIGNAL(timeout()),
+ this, TQT_SLOT(slotAutoScroll()));
m_scrollTimer->start(100, false);
}
}
else if (m_scrollTimer != 0) {
- disconnect(m_scrollTimer, SIGNAL(timeout()),
- this, SLOT(slotAutoScroll()));
+ disconnect(m_scrollTimer, TQT_SIGNAL(timeout()),
+ this, TQT_SLOT(slotAutoScroll()));
m_scrollTimer->stop();
delete m_scrollTimer;
m_scrollTimer = 0;
@@ -605,8 +605,8 @@ void DolphinDetailsView::updateColumnsWidth()
// the column must be available, so that the header is readable.
// TODO: use header data instead of the hardcoded 64 value...
int columnWidth = 64;
- QFontMetrics fontMetrics(font());
- for (QListViewItem* item = firstChild(); item != 0; item = item->nextSibling()) {
+ TQFontMetrics fontMetrics(font());
+ for (TQListViewItem* item = firstChild(); item != 0; item = item->nextSibling()) {
const int width = item->width(fontMetrics, this, i);
if (width > columnWidth) {
columnWidth = width;
@@ -626,8 +626,8 @@ void DolphinDetailsView::updateColumnsWidth()
setColumnWidth(0, firstColumnWidth);
}
-void DolphinDetailsView::slotItemRenamed(QListViewItem* item,
- const QString& name,
+void DolphinDetailsView::slotItemRenamed(TQListViewItem* item,
+ const TQString& name,
int /* column */)
{
KFileItem* fileInfo = static_cast<KFileListViewItem*>(item)->fileInfo();
@@ -636,7 +636,7 @@ void DolphinDetailsView::slotItemRenamed(QListViewItem* item,
void DolphinDetailsView::slotHeaderClicked(int /* section */)
{
- // The sorting has already been changed in QListView if this slot is
+ // The sorting has already been changed in TQListView if this slot is
// invoked, but Dolphin was not informed about this (no signal is available
// which indicates a change of the sorting). This is bypassed by changing
// the sorting and sort order to a temporary other value and readjust it again.
@@ -650,15 +650,15 @@ void DolphinDetailsView::slotHeaderClicked(int /* section */)
default: break;
}
- const Qt::SortOrder currSortOrder = sortOrder();
+ const TQt::SortOrder currSortOrder = sortOrder();
// temporary adjust the sorting and sort order to different values...
const DolphinView::Sorting tempSorting = (sorting == DolphinView::SortByName) ?
DolphinView::SortBySize :
DolphinView::SortByName;
m_dolphinView->setSorting(tempSorting);
- const Qt::SortOrder tempSortOrder = (currSortOrder == Qt::Ascending) ?
- Qt::Descending : Qt::Ascending;
+ const TQt::SortOrder tempSortOrder = (currSortOrder == TQt::Ascending) ?
+ TQt::Descending : TQt::Ascending;
m_dolphinView->setSortOrder(tempSortOrder);
// ... so that setting them again results in storing the new setting.
@@ -667,9 +667,9 @@ void DolphinDetailsView::slotHeaderClicked(int /* section */)
}
}
-DolphinDetailsView::DolphinListViewItem::DolphinListViewItem(QListView* parent,
+DolphinDetailsView::DolphinListViewItem::DolphinListViewItem(TQListView* tqparent,
KFileItem* fileItem) :
- KFileListViewItem(parent, fileItem)
+ KFileListViewItem(tqparent, fileItem)
{
const int iconSize = DolphinSettings::instance().detailsView()->iconSize();
KFileItem* info = fileInfo();
@@ -683,14 +683,14 @@ DolphinDetailsView::DolphinListViewItem::DolphinListViewItem(QListView* parent,
setText(SizeColumn, " - ");
}
else {
- QString sizeText(KIO::convertSize(fileItem->size()));
+ TQString sizeText(KIO::convertSize(fileItem->size()));
sizeText.append(" ");
setText(SizeColumn, sizeText);
}
// Dolphin allows to remove specific columns, but the base class KFileListViewItem
// is not aware about this (or at least the class KFileDetailView does not react on
- // QListView::remove()). Therefore the columns are rearranged here.
+ // TQListView::remove()). Therefore the columns are rearranged here.
const DolphinDetailsViewSettings* settings = DolphinSettings::instance().detailsView();
assert(settings != 0);
@@ -709,42 +709,42 @@ DolphinDetailsView::DolphinListViewItem::~DolphinListViewItem()
{
}
-void DolphinDetailsView::DolphinListViewItem::paintCell(QPainter* painter,
- const QColorGroup& colorGroup,
+void DolphinDetailsView::DolphinListViewItem::paintCell(TQPainter* painter,
+ const TQColorGroup& tqcolorGroup,
int column,
int cellWidth,
- int alignment)
+ int tqalignment)
{
- const QListView* view = listView();
- const bool isActive = view->parent() == Dolphin::mainWin().activeView();
+ const TQListView* view = listView();
+ const bool isActive = TQT_BASE_OBJECT(view->tqparent()) == TQT_BASE_OBJECT(Dolphin::mainWin().activeView());
if (isSelected()) {
// Per default the selection is drawn above the whole width of the item. As a consistent
// behavior with the icon view is wanted, only the the column containing the file name
// should be shown as selected.
- QColorGroup defaultColorGroup(colorGroup);
- const QColor highlightColor(isActive ? backgroundColor(column) : view->colorGroup().background());
- defaultColorGroup.setColor(QColorGroup::Highlight , highlightColor);
- defaultColorGroup.setColor(QColorGroup::HighlightedText, colorGroup.color(QColorGroup::Text));
- KFileListViewItem::paintCell(painter, defaultColorGroup, column, cellWidth, alignment);
+ TQColorGroup defaultColorGroup(tqcolorGroup);
+ const TQColor highlightColor(isActive ? backgroundColor(column) : view->tqcolorGroup().background());
+ defaultColorGroup.setColor(TQColorGroup::Highlight , highlightColor);
+ defaultColorGroup.setColor(TQColorGroup::HighlightedText, tqcolorGroup.color(TQColorGroup::Text));
+ KFileListViewItem::paintCell(painter, defaultColorGroup, column, cellWidth, tqalignment);
if (column == 0) {
// draw the selection only on the first column
- QListView* parent = listView();
- const int itemWidth = width(parent->fontMetrics(), parent, 0);
+ TQListView* tqparent = listView();
+ const int itemWidth = width(tqparent->fontMetrics(), tqparent, 0);
if (isActive) {
- KFileListViewItem::paintCell(painter, colorGroup, column, itemWidth, alignment);
+ KFileListViewItem::paintCell(painter, tqcolorGroup, column, itemWidth, tqalignment);
}
else {
- QListViewItem::paintCell(painter, colorGroup, column, itemWidth, alignment);
+ TQListViewItem::paintCell(painter, tqcolorGroup, column, itemWidth, tqalignment);
}
}
}
else {
if (isActive) {
- KFileListViewItem::paintCell(painter, colorGroup, column, cellWidth, alignment);
+ KFileListViewItem::paintCell(painter, tqcolorGroup, column, cellWidth, tqalignment);
}
else {
- QListViewItem::paintCell(painter, colorGroup, column, cellWidth, alignment);
+ TQListViewItem::paintCell(painter, tqcolorGroup, column, cellWidth, tqalignment);
}
}
@@ -755,26 +755,26 @@ void DolphinDetailsView::DolphinListViewItem::paintCell(QPainter* painter,
}
}
-void DolphinDetailsView::DolphinListViewItem::paintFocus(QPainter* painter,
- const QColorGroup& colorGroup,
- const QRect& rect)
+void DolphinDetailsView::DolphinListViewItem::paintFocus(TQPainter* painter,
+ const TQColorGroup& tqcolorGroup,
+ const TQRect& rect)
{
// draw the focus consistently with the selection (see implementation notes
// in DolphinListViewItem::paintCell)
- QListView* parent = listView();
- int visibleWidth = width(parent->fontMetrics(), parent, 0);
- const int colWidth = parent->columnWidth(0);
+ TQListView* tqparent = listView();
+ int visibleWidth = width(tqparent->fontMetrics(), tqparent, 0);
+ const int colWidth = tqparent->columnWidth(0);
if (visibleWidth > colWidth) {
visibleWidth = colWidth;
}
- QRect focusRect(rect);
+ TQRect focusRect(rect);
focusRect.setWidth(visibleWidth);
- KFileListViewItem::paintFocus(painter, colorGroup, focusRect);
+ KFileListViewItem::paintFocus(painter, tqcolorGroup, focusRect);
}
-int DolphinDetailsView::filenameWidth(const QListViewItem* item) const
+int DolphinDetailsView::filenameWidth(const TQListViewItem* item) const
{
assert(item != 0);