Rename KIcon to enhance compatibility with KDE4

pull/1/head
Timothy Pearson 12 years ago
parent 32932d14f9
commit 8773bce422

@ -68,7 +68,7 @@ void BookmarksSidebarPage::updateBookmarks()
{
m_bookmarksList->clear();
KIconLoader iconLoader;
TDEIconLoader iconLoader;
KBookmarkGroup root = DolphinSettings::instance().bookmarkManager()->root();
KBookmark bookmark = root.first();
@ -324,9 +324,9 @@ const KURL& BookmarkItem::url() const
return m_url;
}
BookmarkItem* BookmarkItem::fromKbookmark(const KBookmark& bookmark, const KIconLoader& iconLoader)
BookmarkItem* BookmarkItem::fromKbookmark(const KBookmark& bookmark, const TDEIconLoader& iconLoader)
{
TQPixmap icon(iconLoader.loadIcon(bookmark.icon(), KIcon::NoGroup, KIcon::SizeMedium));
TQPixmap icon(iconLoader.loadIcon(bookmark.icon(), TDEIcon::NoGroup, TDEIcon::SizeMedium));
return new BookmarkItem(icon, bookmark.text(), bookmark.url());
}

@ -132,7 +132,7 @@ public:
virtual int height(const TQListBox* listBox) const;
const KURL& url() const;
static BookmarkItem* fromKbookmark(const KBookmark& bookmark, const KIconLoader& iconLoader);
static BookmarkItem* fromKbookmark(const KBookmark& bookmark, const TDEIconLoader& iconLoader);
private:
KURL m_url;

@ -82,15 +82,15 @@ DetailsViewSettingsPage::DetailsViewSettingsPage(TQWidget *parent) :
m_mediumIconSize = new TQRadioButton(i18n("Medium"), iconSizeGroup);
m_largeIconSize = new TQRadioButton(i18n("Large"), iconSizeGroup);
switch (settings->iconSize()) {
case KIcon::SizeLarge:
case TDEIcon::SizeLarge:
m_largeIconSize->setChecked(true);
break;
case KIcon::SizeMedium:
case TDEIcon::SizeMedium:
m_mediumIconSize->setChecked(true);
break;
case KIcon::SizeSmall:
case TDEIcon::SizeSmall:
default:
m_smallIconSize->setChecked(true);
}
@ -139,12 +139,12 @@ void DetailsViewSettingsPage::applySettings()
settings->setColumnEnabled(DolphinDetailsView::GroupColumn,
m_groupBox->isChecked());
int iconSize = KIcon::SizeSmall;
int iconSize = TDEIcon::SizeSmall;
if (m_mediumIconSize->isChecked()) {
iconSize = KIcon::SizeMedium;
iconSize = TDEIcon::SizeMedium;
}
else if (m_largeIconSize->isChecked()) {
iconSize = KIcon::SizeLarge;
iconSize = TDEIcon::SizeLarge;
}
settings->setIconSize(iconSize);

@ -319,7 +319,7 @@ int DolphinContextMenu::insertOpenWithItems(TDEPopupMenu* popup,
// will be skipped here.
const TQString appName((*it)->name());
if (!containsEntry(openWithMenu, appName)) {
openWithMenu->insertItem((*it)->pixmap(KIcon::Small),
openWithMenu->insertItem((*it)->pixmap(TDEIcon::Small),
appName, index);
openWithVector.append(*it);
++index;

@ -179,8 +179,8 @@ void DolphinDetailsView::zoomIn()
if (isZoomInPossible()) {
DolphinDetailsViewSettings* settings = DolphinSettings::instance().detailsView();
switch (settings->iconSize()) {
case KIcon::SizeSmall: settings->setIconSize(KIcon::SizeMedium); break;
case KIcon::SizeMedium: settings->setIconSize(KIcon::SizeLarge); break;
case TDEIcon::SizeSmall: settings->setIconSize(TDEIcon::SizeMedium); break;
case TDEIcon::SizeMedium: settings->setIconSize(TDEIcon::SizeLarge); break;
default: assert(false); break;
}
ItemEffectsManager::zoomIn();
@ -192,8 +192,8 @@ void DolphinDetailsView::zoomOut()
if (isZoomOutPossible()) {
DolphinDetailsViewSettings* settings = DolphinSettings::instance().detailsView();
switch (settings->iconSize()) {
case KIcon::SizeLarge: settings->setIconSize(KIcon::SizeMedium); break;
case KIcon::SizeMedium: settings->setIconSize(KIcon::SizeSmall); break;
case TDEIcon::SizeLarge: settings->setIconSize(TDEIcon::SizeMedium); break;
case TDEIcon::SizeMedium: settings->setIconSize(TDEIcon::SizeSmall); break;
default: assert(false); break;
}
ItemEffectsManager::zoomOut();
@ -203,13 +203,13 @@ void DolphinDetailsView::zoomOut()
bool DolphinDetailsView::isZoomInPossible() const
{
DolphinDetailsViewSettings* settings = DolphinSettings::instance().detailsView();
return settings->iconSize() < KIcon::SizeLarge;
return settings->iconSize() < TDEIcon::SizeLarge;
}
bool DolphinDetailsView::isZoomOutPossible() const
{
DolphinDetailsViewSettings* settings = DolphinSettings::instance().detailsView();
return settings->iconSize() > KIcon::SizeSmall;
return settings->iconSize() > TDEIcon::SizeSmall;
}
void DolphinDetailsView::resizeContents(int width, int height)

@ -47,7 +47,7 @@ DolphinDetailsViewSettings::DolphinDetailsViewSettings() :
setColumnEnabled(DolphinDetailsView::GroupColumn, showGroup);
// read icon size
m_iconSize = config->readNumEntry("Icon Size", KIcon::SizeSmall);
m_iconSize = config->readNumEntry("Icon Size", TDEIcon::SizeSmall);
// read font size and font family
m_fontSize = config->readNumEntry("Font Size", -1);

@ -45,7 +45,7 @@ DolphinIconsView::DolphinIconsView(DolphinView* parent, LayoutMode layoutMode) :
m_dolphinView(parent)
{
setAcceptDrops(true);
setMode(KIconView::Execute);
setMode(TDEIconView::Execute);
setSelectionMode(KFile::Extended);
Dolphin& dolphin = Dolphin::mainWin();
@ -207,13 +207,13 @@ bool DolphinIconsView::isZoomInPossible() const
{
DolphinIconsViewSettings* settings = DolphinSettings::instance().iconsView(m_layoutMode);
const int size = (m_layoutMode == Icons) ? settings->iconSize() : settings->previewSize();
return size < KIcon::SizeEnormous;
return size < TDEIcon::SizeEnormous;
}
bool DolphinIconsView::isZoomOutPossible() const
{
DolphinIconsViewSettings* settings = DolphinSettings::instance().iconsView(m_layoutMode);
return settings->iconSize() > KIcon::SizeSmall;
return settings->iconSize() > TDEIcon::SizeSmall;
}
void DolphinIconsView::arrangeItemsInGrid( bool updated )
@ -473,11 +473,11 @@ int DolphinIconsView::increasedIconSize(int size) const
{
int incSize = 0;
switch (size) {
case KIcon::SizeSmall: incSize = KIcon::SizeSmallMedium; break;
case KIcon::SizeSmallMedium: incSize = KIcon::SizeMedium; break;
case KIcon::SizeMedium: incSize = KIcon::SizeLarge; break;
case KIcon::SizeLarge: incSize = KIcon::SizeHuge; break;
case KIcon::SizeHuge: incSize = KIcon::SizeEnormous; break;
case TDEIcon::SizeSmall: incSize = TDEIcon::SizeSmallMedium; break;
case TDEIcon::SizeSmallMedium: incSize = TDEIcon::SizeMedium; break;
case TDEIcon::SizeMedium: incSize = TDEIcon::SizeLarge; break;
case TDEIcon::SizeLarge: incSize = TDEIcon::SizeHuge; break;
case TDEIcon::SizeHuge: incSize = TDEIcon::SizeEnormous; break;
default: assert(false); break;
}
return incSize;
@ -487,11 +487,11 @@ int DolphinIconsView::decreasedIconSize(int size) const
{
int decSize = 0;
switch (size) {
case KIcon::SizeSmallMedium: decSize = KIcon::SizeSmall; break;
case KIcon::SizeMedium: decSize = KIcon::SizeSmallMedium; break;
case KIcon::SizeLarge: decSize = KIcon::SizeMedium; break;
case KIcon::SizeHuge: decSize = KIcon::SizeLarge; break;
case KIcon::SizeEnormous: decSize = KIcon::SizeHuge; break;
case TDEIcon::SizeSmallMedium: decSize = TDEIcon::SizeSmall; break;
case TDEIcon::SizeMedium: decSize = TDEIcon::SizeSmallMedium; break;
case TDEIcon::SizeLarge: decSize = TDEIcon::SizeMedium; break;
case TDEIcon::SizeHuge: decSize = TDEIcon::SizeLarge; break;
case TDEIcon::SizeEnormous: decSize = TDEIcon::SizeHuge; break;
default: assert(false); break;
}
return decSize;

@ -27,10 +27,10 @@
DolphinIconsViewSettings::DolphinIconsViewSettings(DolphinIconsView::LayoutMode mode) :
m_arrangement(TQIconView::LeftToRight),
m_layoutMode(mode),
m_iconSize(KIcon::SizeMedium),
m_previewSize(KIcon::SizeMedium),
m_iconSize(TDEIcon::SizeMedium),
m_previewSize(TDEIcon::SizeMedium),
m_gridWidth(0),
m_gridHeight(KIcon::SizeMedium),
m_gridHeight(TDEIcon::SizeMedium),
m_gridSpacing(8),
m_fontSize(0),
m_textlinesCount(2)
@ -41,7 +41,7 @@ DolphinIconsViewSettings::DolphinIconsViewSettings(DolphinIconsView::LayoutMode
// read icon size
m_iconSize = config->readNumEntry("Icon Size", -1);
if (m_iconSize < 0) {
m_iconSize = KIcon::SizeMedium;
m_iconSize = TDEIcon::SizeMedium;
}
// read arrangement
@ -61,14 +61,14 @@ DolphinIconsViewSettings::DolphinIconsViewSettings(DolphinIconsView::LayoutMode
if (mode == DolphinIconsView::Previews) {
if (m_previewSize < 0) {
m_previewSize = KIcon::SizeEnormous;
m_previewSize = TDEIcon::SizeEnormous;
}
if (m_gridWidth < 0) {
m_gridWidth = m_previewSize + (m_previewSize / 2);
}
}
else if (m_gridWidth < 0) {
m_gridWidth = m_iconSize + (m_iconSize / 2) + (KIcon::SizeLarge * 2);
m_gridWidth = m_iconSize + (m_iconSize / 2) + (TDEIcon::SizeLarge * 2);
}
if (m_gridHeight < 0) {
@ -142,14 +142,14 @@ void DolphinIconsViewSettings::calculateGridSize(int hint)
const int maxSize = (m_previewSize > m_iconSize) ? m_previewSize : m_iconSize;
if (m_arrangement == TQIconView::LeftToRight) {
int widthUnit = maxSize + (maxSize / 2);
if (widthUnit < KIcon::SizeLarge) {
widthUnit = KIcon::SizeLarge;
if (widthUnit < TDEIcon::SizeLarge) {
widthUnit = TDEIcon::SizeLarge;
}
//m_gridWidth = widthUnit + hint * KIcon::SizeLarge;
m_gridWidth = widthUnit + hint * KIcon::SizeLarge;
//m_gridWidth = widthUnit + hint * TDEIcon::SizeLarge;
m_gridWidth = widthUnit + hint * TDEIcon::SizeLarge;
m_gridHeight = m_iconSize;
if (m_gridHeight <= KIcon::SizeMedium) {
if (m_gridHeight <= TDEIcon::SizeMedium) {
m_gridHeight = m_gridHeight * 2;
}
else {
@ -172,10 +172,10 @@ int DolphinIconsViewSettings::textWidthHint() const
int hint = 0;
if (m_arrangement == TQIconView::LeftToRight) {
int widthUnit = maxSize + (maxSize / 2);
if (widthUnit < KIcon::SizeLarge) {
widthUnit = KIcon::SizeLarge;
if (widthUnit < TDEIcon::SizeLarge) {
widthUnit = TDEIcon::SizeLarge;
}
hint = (m_gridWidth - widthUnit) / KIcon::SizeLarge;
hint = (m_gridWidth - widthUnit) / TDEIcon::SizeLarge;
}
else {
assert(m_arrangement == TQIconView::TopToBottom);

@ -30,23 +30,23 @@ DolphinSettingsDialog::DolphinSettingsDialog() :
KDialogBase(IconList, i18n("D3lphin Preferences"),
Ok|Apply|Cancel, Ok)
{
KIconLoader iconLoader;
TDEIconLoader iconLoader;
TQFrame* generalSettingsFrame = addPage(i18n("General"), 0,
iconLoader.loadIcon("exec",
KIcon::NoGroup,
KIcon::SizeMedium));
TDEIcon::NoGroup,
TDEIcon::SizeMedium));
m_generalSettingsPage = new GeneralSettingsPage(generalSettingsFrame);
TQFrame* viewSettingsFrame = addPage(i18n("View Modes"), 0,
iconLoader.loadIcon("view_choose",
KIcon::NoGroup,
KIcon::SizeMedium));
TDEIcon::NoGroup,
TDEIcon::SizeMedium));
m_viewSettingsPage = new ViewSettingsPage(viewSettingsFrame);
TQFrame* bookmarksSettingsFrame = addPage(i18n("Bookmarks"), 0,
iconLoader.loadIcon("bookmark",
KIcon::NoGroup,
KIcon::SizeMedium));
TDEIcon::NoGroup,
TDEIcon::SizeMedium));
m_bookmarksSettingsPage = new BookmarksSettingsPage(bookmarksSettingsFrame);
}

@ -102,7 +102,7 @@ DolphinView::DolphinView(TQWidget *parent,
connect(m_dirLister, TQT_SIGNAL(newItems(const KFileItemList&)),
this, TQT_SLOT(slotAddItems(const KFileItemList&)));
m_iconSize = KIcon::SizeMedium;
m_iconSize = TDEIcon::SizeMedium;
m_topLayout->addWidget(m_urlNavigator);
createView();

@ -101,7 +101,7 @@ EditBookmarkDialog::EditBookmarkDialog(const TQString& title,
void EditBookmarkDialog::selectIcon()
{
const TQString iconName(KIconDialog::getIcon(KIcon::Small, KIcon::Place));
const TQString iconName(TDEIconDialog::getIcon(TDEIcon::Small, TDEIcon::Place));
if (!iconName.isEmpty()) {
m_iconName = iconName;
m_iconButton->setIconSet(SmallIcon(iconName));

@ -83,8 +83,8 @@ IconsViewSettingsPage::IconsViewSettingsPage(DolphinIconsView::LayoutMode mode,
new TQLabel(i18n("Large"), iconSizeVBox);
m_iconSizeViewer = new PixmapViewer(iconSizeGroup);
m_iconSizeViewer->setMinimumWidth(KIcon::SizeEnormous);
m_iconSizeViewer->setFixedHeight(KIcon::SizeEnormous);
m_iconSizeViewer->setMinimumWidth(TDEIcon::SizeEnormous);
m_iconSizeViewer->setFixedHeight(TDEIcon::SizeEnormous);
m_iconSizeViewer->setEraseColor(iconBackgroundColor);
slotIconSizeChanged(m_iconSizeSlider->value());
@ -105,8 +105,8 @@ IconsViewSettingsPage::IconsViewSettingsPage(DolphinIconsView::LayoutMode mode,
new TQLabel(i18n("Large"), previewSizeVBox);
m_previewSizeViewer = new PixmapViewer(previewSizeGroup);
m_previewSizeViewer->setMinimumWidth(KIcon::SizeEnormous);
m_previewSizeViewer->setFixedHeight(KIcon::SizeEnormous);
m_previewSizeViewer->setMinimumWidth(TDEIcon::SizeEnormous);
m_previewSizeViewer->setFixedHeight(TDEIcon::SizeEnormous);
m_previewSizeViewer->setEraseColor(iconBackgroundColor);
slotPreviewSizeChanged(m_previewSizeSlider->value());
@ -199,8 +199,8 @@ void IconsViewSettingsPage::applySettings()
void IconsViewSettingsPage::slotIconSizeChanged(int value)
{
KIconLoader iconLoader;
m_iconSizeViewer->setPixmap(iconLoader.loadIcon("folder", KIcon::Desktop, iconSize(value)));
TDEIconLoader iconLoader;
m_iconSizeViewer->setPixmap(iconLoader.loadIcon("folder", TDEIcon::Desktop, iconSize(value)));
if (m_previewSizeSlider != 0) {
int previewSizeValue = m_previewSizeSlider->value();
@ -214,25 +214,25 @@ void IconsViewSettingsPage::slotIconSizeChanged(int value)
void IconsViewSettingsPage::slotPreviewSizeChanged(int value)
{
KIconLoader iconLoader;
TDEIconLoader iconLoader;
const int iconSizeValue = m_iconSizeSlider->value();
if (value < iconSizeValue) {
// assure that the preview size is never smaller than the icon size
value = iconSizeValue;
}
m_previewSizeViewer->setPixmap(iconLoader.loadIcon("preview", KIcon::Desktop, iconSize(value)));
m_previewSizeViewer->setPixmap(iconLoader.loadIcon("preview", TDEIcon::Desktop, iconSize(value)));
}
int IconsViewSettingsPage::iconSize(int sliderValue) const
{
int size = KIcon::SizeMedium;
int size = TDEIcon::SizeMedium;
switch (sliderValue) {
case 0: size = KIcon::SizeSmall; break;
case 1: size = KIcon::SizeSmallMedium; break;
case 2: size = KIcon::SizeMedium; break;
case 3: size = KIcon::SizeLarge; break;
case 4: size = KIcon::SizeHuge; break;
case 5: size = KIcon::SizeEnormous; break;
case 0: size = TDEIcon::SizeSmall; break;
case 1: size = TDEIcon::SizeSmallMedium; break;
case 2: size = TDEIcon::SizeMedium; break;
case 3: size = TDEIcon::SizeLarge; break;
case 4: size = TDEIcon::SizeHuge; break;
case 5: size = TDEIcon::SizeEnormous; break;
}
return size;
}
@ -241,12 +241,12 @@ int IconsViewSettingsPage::sliderValue(int iconSize) const
{
int value = 0;
switch (iconSize) {
case KIcon::SizeSmall: value = 0; break;
case KIcon::SizeSmallMedium: value = 1; break;
case KIcon::SizeMedium: value = 2; break;
case KIcon::SizeLarge: value = 3; break;
case KIcon::SizeHuge: value = 4; break;
case KIcon::SizeEnormous: value = 5; break;
case TDEIcon::SizeSmall: value = 0; break;
case TDEIcon::SizeSmallMedium: value = 1; break;
case TDEIcon::SizeMedium: value = 2; break;
case TDEIcon::SizeLarge: value = 3; break;
case TDEIcon::SizeHuge: value = 4; break;
case TDEIcon::SizeEnormous: value = 5; break;
default: break;
}
return value;

@ -68,8 +68,8 @@ InfoSidebarPage::InfoSidebarPage(TQWidget* parent) :
// preview
m_preview = new PixmapViewer(this);
m_preview->setMinimumWidth(KIcon::SizeEnormous);
m_preview->setFixedHeight(KIcon::SizeEnormous);
m_preview->setMinimumWidth(TDEIcon::SizeEnormous);
m_preview->setFixedHeight(TDEIcon::SizeEnormous);
// name
m_name = new TQLabel(this);
@ -155,10 +155,10 @@ void InfoSidebarPage::showItemInfo()
}
if (m_multipleSelection) {
KIconLoader iconLoader;
TDEIconLoader iconLoader;
TQPixmap icon = iconLoader.loadIcon("exec",
KIcon::NoGroup,
KIcon::SizeEnormous);
TDEIcon::NoGroup,
TDEIcon::SizeEnormous);
m_preview->setPixmap(icon);
m_name->setText(i18n("%n items selected", "%n items selected", selectedItems->count()));
}
@ -172,7 +172,7 @@ void InfoSidebarPage::showItemInfo()
TDEIO::PreviewJob* job = TDEIO::filePreview(list,
m_preview->width(),
KIcon::SizeEnormous);
TDEIcon::SizeEnormous);
connect(job, TQT_SIGNAL(gotPreview(const KFileItem*, const TQPixmap&)),
this, TQT_SLOT(gotPreview(const KFileItem*, const TQPixmap&)));
connect(job, TQT_SIGNAL(failed(const KFileItem*)),
@ -198,7 +198,7 @@ void InfoSidebarPage::slotPreviewFailed(const KFileItem* item)
{
m_pendingPreview = false;
if (!applyBookmark()) {
m_preview->setPixmap(item->pixmap(KIcon::SizeEnormous));
m_preview->setPixmap(item->pixmap(TDEIcon::SizeEnormous));
}
}
@ -248,10 +248,10 @@ bool InfoSidebarPage::applyBookmark()
text.append("</b>");
m_name->setText(text);
KIconLoader iconLoader;
TDEIconLoader iconLoader;
TQPixmap icon = iconLoader.loadIcon(bookmark.icon(),
KIcon::NoGroup,
KIcon::SizeEnormous);
TDEIcon::NoGroup,
TDEIcon::SizeEnormous);
m_preview->setPixmap(icon);
return true;
}
@ -570,12 +570,12 @@ void ServiceButton::drawButton(TQPainter* painter)
// draw icon
int x = spacing;
const int y = (buttonHeight - KIcon::SizeSmall) / 2;
const int y = (buttonHeight - TDEIcon::SizeSmall) / 2;
const TQIconSet* set = iconSet();
if (set != 0) {
painter->drawPixmap(x, y, set->pixmap(TQIconSet::Small, TQIconSet::Normal));
}
x += KIcon::SizeSmall + spacing;
x += TDEIcon::SizeSmall + spacing;
// draw text
painter->setPen(foregroundColor);

@ -72,10 +72,10 @@ void ItemEffectsManager::activateItem(void* context)
m_highlightedURL = itemURL;
// apply an icon effect to the item below the mouse pointer
KIconEffect iconEffect;
TDEIconEffect iconEffect;
TQPixmap pixmap = iconEffect.apply(*itemPixmap,
KIcon::Desktop,
KIcon::ActiveState);
TDEIcon::Desktop,
TDEIcon::ActiveState);
setContextPixmap(context, pixmap);
}
@ -95,10 +95,10 @@ void ItemEffectsManager::resetActivatedItem()
KURL itemURL(contextFileInfo(context)->url());
if (itemURL == m_highlightedURL) {
// the highlighted item has been found and is restored to the default state
KIconEffect iconEffect;
TDEIconEffect iconEffect;
TQPixmap pixmap = iconEffect.apply(*m_pixmapCopy,
KIcon::Desktop,
KIcon::DefaultState);
TDEIcon::Desktop,
TDEIcon::DefaultState);
// TODO: KFileIconView does not emit any signal when the preview has been finished.
// Hence check the size to prevent that a preview is hidden by restoring a
@ -164,10 +164,10 @@ void ItemEffectsManager::updateDisabledItems()
disabledItem.pixmap = *itemPixmap;
m_disabledItems.append(disabledItem);
KIconEffect iconEffect;
TDEIconEffect iconEffect;
TQPixmap disabledPixmap = iconEffect.apply(*itemPixmap,
KIcon::Desktop,
KIcon::DisabledState);
TDEIcon::Desktop,
TDEIcon::DisabledState);
setContextPixmap(context, disabledPixmap);
}
break;

@ -27,8 +27,8 @@
PixmapViewer::PixmapViewer(TQWidget* parent) :
TQWidget(parent)
{
setMinimumWidth(KIcon::SizeEnormous);
setMinimumWidth(KIcon::SizeEnormous);
setMinimumWidth(TDEIcon::SizeEnormous);
setMinimumWidth(TDEIcon::SizeEnormous);
}
PixmapViewer::~PixmapViewer()

@ -33,7 +33,7 @@ StatusBarMessageLabel::StatusBarMessageLabel(TQWidget* parent) :
m_minTextHeight(-1),
m_timer(0)
{
setMinimumHeight(KIcon::SizeSmall);
setMinimumHeight(TDEIcon::SizeSmall);
m_timer = new TQTimer(this);
connect(m_timer, TQT_SIGNAL(timeout()),

Loading…
Cancel
Save