From dfe289850f068f19ba4a83ab4e7e22a7e09c13c9 Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Sat, 26 Jan 2013 13:17:21 -0600 Subject: Rename a number of libraries and executables to avoid conflicts with KDE4 --- tdehtml/tdehtml_ext.cpp | 1032 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 1032 insertions(+) create mode 100644 tdehtml/tdehtml_ext.cpp (limited to 'tdehtml/tdehtml_ext.cpp') diff --git a/tdehtml/tdehtml_ext.cpp b/tdehtml/tdehtml_ext.cpp new file mode 100644 index 000000000..62a5293c1 --- /dev/null +++ b/tdehtml/tdehtml_ext.cpp @@ -0,0 +1,1032 @@ +// -*- c-basic-offset: 2 -*- +/* This file is part of the KDE project + * + * Copyright (C) 2000-2003 Simon Hausmann + * 2001-2003 George Staikos + * 2001-2003 Laurent Montel + * 2001-2003 Dirk Mueller + * 2001-2003 Waldo Bastian + * 2001-2003 David Faure + * 2001-2003 Daniel Naber + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public License + * along with this library; see the file COPYING.LIB. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ + +#include +#include "tdehtml_ext.h" +#include "tdehtmlview.h" +#include "tdehtml_pagecache.h" +#include "rendering/render_form.h" +#include "rendering/render_image.h" +#include "html/html_imageimpl.h" +#include "misc/loader.h" +#include "dom/html_form.h" +#include "dom/html_image.h" +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "tdehtml_factory.h" + +#include "dom/dom_element.h" +#include "misc/htmltags.h" + +#include "tdehtmlpart_p.h" + +KHTMLPartBrowserExtension::KHTMLPartBrowserExtension( KHTMLPart *parent, const char *name ) +: KParts::BrowserExtension( parent, name ) +{ + m_part = parent; + setURLDropHandlingEnabled( true ); + + enableAction( "cut", false ); + enableAction( "copy", false ); + enableAction( "paste", false ); + + m_connectedToClipboard = false; +} + +int KHTMLPartBrowserExtension::xOffset() +{ + return m_part->view()->contentsX(); +} + +int KHTMLPartBrowserExtension::yOffset() +{ + return m_part->view()->contentsY(); +} + +void KHTMLPartBrowserExtension::saveState( TQDataStream &stream ) +{ + //kdDebug( 6050 ) << "saveState!" << endl; + m_part->saveState( stream ); +} + +void KHTMLPartBrowserExtension::restoreState( TQDataStream &stream ) +{ + //kdDebug( 6050 ) << "restoreState!" << endl; + m_part->restoreState( stream ); +} + +void KHTMLPartBrowserExtension::editableWidgetFocused( TQWidget *widget ) +{ + m_editableFormWidget = widget; + updateEditActions(); + + if ( !m_connectedToClipboard && m_editableFormWidget ) + { + connect( TQApplication::clipboard(), TQT_SIGNAL( dataChanged() ), + this, TQT_SLOT( updateEditActions() ) ); + + if ( m_editableFormWidget->inherits( TQLINEEDIT_OBJECT_NAME_STRING ) || m_editableFormWidget->inherits( TQTEXTEDIT_OBJECT_NAME_STRING ) ) + connect( m_editableFormWidget, TQT_SIGNAL( selectionChanged() ), + this, TQT_SLOT( updateEditActions() ) ); + + m_connectedToClipboard = true; + } + editableWidgetFocused(); +} + +void KHTMLPartBrowserExtension::editableWidgetBlurred( TQWidget * /*widget*/ ) +{ + TQWidget *oldWidget = m_editableFormWidget; + + m_editableFormWidget = 0; + enableAction( "cut", false ); + enableAction( "paste", false ); + m_part->emitSelectionChanged(); + + if ( m_connectedToClipboard ) + { + disconnect( TQApplication::clipboard(), TQT_SIGNAL( dataChanged() ), + this, TQT_SLOT( updateEditActions() ) ); + + if ( oldWidget ) + { + if ( oldWidget->inherits( TQLINEEDIT_OBJECT_NAME_STRING ) || oldWidget->inherits( TQTEXTEDIT_OBJECT_NAME_STRING ) ) + disconnect( oldWidget, TQT_SIGNAL( selectionChanged() ), + this, TQT_SLOT( updateEditActions() ) ); + } + + m_connectedToClipboard = false; + } + editableWidgetBlurred(); +} + +void KHTMLPartBrowserExtension::setExtensionProxy( KParts::BrowserExtension *proxy ) +{ + if ( m_extensionProxy ) + { + disconnect( m_extensionProxy, TQT_SIGNAL( enableAction( const char *, bool ) ), + this, TQT_SLOT( extensionProxyActionEnabled( const char *, bool ) ) ); + if ( m_extensionProxy->inherits( "KHTMLPartBrowserExtension" ) ) + { + disconnect( m_extensionProxy, TQT_SIGNAL( editableWidgetFocused() ), + this, TQT_SLOT( extensionProxyEditableWidgetFocused() ) ); + disconnect( m_extensionProxy, TQT_SIGNAL( editableWidgetBlurred() ), + this, TQT_SLOT( extensionProxyEditableWidgetBlurred() ) ); + } + } + + m_extensionProxy = proxy; + + if ( m_extensionProxy ) + { + connect( m_extensionProxy, TQT_SIGNAL( enableAction( const char *, bool ) ), + this, TQT_SLOT( extensionProxyActionEnabled( const char *, bool ) ) ); + if ( m_extensionProxy->inherits( "KHTMLPartBrowserExtension" ) ) + { + connect( m_extensionProxy, TQT_SIGNAL( editableWidgetFocused() ), + this, TQT_SLOT( extensionProxyEditableWidgetFocused() ) ); + connect( m_extensionProxy, TQT_SIGNAL( editableWidgetBlurred() ), + this, TQT_SLOT( extensionProxyEditableWidgetBlurred() ) ); + } + + enableAction( "cut", m_extensionProxy->isActionEnabled( "cut" ) ); + enableAction( "copy", m_extensionProxy->isActionEnabled( "copy" ) ); + enableAction( "paste", m_extensionProxy->isActionEnabled( "paste" ) ); + } + else + { + updateEditActions(); + enableAction( "copy", false ); // ### re-check this + } +} + +void KHTMLPartBrowserExtension::cut() +{ + if ( m_extensionProxy ) + { + callExtensionProxyMethod( "cut()" ); + return; + } + + if ( !m_editableFormWidget ) + return; + + if ( m_editableFormWidget->inherits( TQLINEEDIT_OBJECT_NAME_STRING ) ) + static_cast( &(*m_editableFormWidget) )->cut(); + else if ( m_editableFormWidget->inherits( TQTEXTEDIT_OBJECT_NAME_STRING ) ) + static_cast( &(*m_editableFormWidget) )->cut(); +} + +void KHTMLPartBrowserExtension::copy() +{ + if ( m_extensionProxy ) + { + callExtensionProxyMethod( "copy()" ); + return; + } + + kdDebug( 6050 ) << "************! KHTMLPartBrowserExtension::copy()" << endl; + if ( !m_editableFormWidget ) + { + // get selected text and paste to the clipboard + TQString text= m_part->selectedText(); + text.replace( TQChar( 0xa0 ), ' ' ); + + + TQClipboard *cb = TQApplication::clipboard(); + disconnect( cb, TQT_SIGNAL( selectionChanged() ), m_part, TQT_SLOT( slotClearSelection() ) ); +#ifndef QT_NO_MIMECLIPBOARD + TQString htmltext; + /* + * When selectionModeEnabled, that means the user has just selected + * the text, not ctrl+c to copy it. The selection clipboard + * doesn't seem to support mime type, so to save time, don't calculate + * the selected text as html. + * optomisation disabled for now until everything else works. + */ + //if(!cb->selectionModeEnabled()) + htmltext = m_part->selectedTextAsHTML(); + TQTextDrag *textdrag = new TQTextDrag(text, 0L); + KMultipleDrag *drag = new KMultipleDrag( m_editableFormWidget ); + drag->addDragObject( textdrag ); + if(!htmltext.isEmpty()) { + htmltext.replace( TQChar( 0xa0 ), ' ' ); + TQTextDrag *htmltextdrag = new TQTextDrag(htmltext, 0L); + htmltextdrag->setSubtype("html"); + drag->addDragObject( htmltextdrag ); + } + cb->setData(drag); +#else + cb->setText(text); +#endif + + connect( cb, TQT_SIGNAL( selectionChanged() ), m_part, TQT_SLOT( slotClearSelection() ) ); + } + else + { + if ( m_editableFormWidget->inherits( TQLINEEDIT_OBJECT_NAME_STRING ) ) + static_cast( &(*m_editableFormWidget) )->copy(); + else if ( m_editableFormWidget->inherits( TQTEXTEDIT_OBJECT_NAME_STRING ) ) + static_cast( &(*m_editableFormWidget) )->copy(); + } +} + +void KHTMLPartBrowserExtension::searchProvider() +{ + // action name is of form "previewProvider[:]" + const TQString searchProviderPrefix = TQString( TQT_TQOBJECT_CONST(sender())->name() ).mid( 14 ); + + KURIFilterData data; + TQStringList list; + data.setData( searchProviderPrefix + m_part->selectedText() ); + list << "kurisearchfilter" << "kuriikwsfilter"; + + if( !KURIFilter::self()->filterURI(data, list) ) + { + KDesktopFile file("searchproviders/google.desktop", true, "services"); + TQString encodedSearchTerm = m_part->selectedText(); + TQUrl::encode(encodedSearchTerm); + data.setData(file.readEntry("Query").replace("\\{@}", encodedSearchTerm)); + } + + KParts::URLArgs args; + args.frameName = "_blank"; + + emit m_part->browserExtension()->openURLRequest( data.uri(), args ); +} + +void KHTMLPartBrowserExtension::openSelection() +{ + KParts::URLArgs args; + args.frameName = "_blank"; + + emit m_part->browserExtension()->openURLRequest( m_part->selectedText(), args ); +} + +void KHTMLPartBrowserExtension::paste() +{ + if ( m_extensionProxy ) + { + callExtensionProxyMethod( "paste()" ); + return; + } + + if ( !m_editableFormWidget ) + return; + + if ( m_editableFormWidget->inherits( TQLINEEDIT_OBJECT_NAME_STRING ) ) + static_cast( &(*m_editableFormWidget) )->paste(); + else if ( m_editableFormWidget->inherits( TQTEXTEDIT_OBJECT_NAME_STRING ) ) + static_cast( &(*m_editableFormWidget) )->paste(); +} + +void KHTMLPartBrowserExtension::callExtensionProxyMethod( const char *method ) +{ + if ( !m_extensionProxy ) + return; + + int slot = m_extensionProxy->metaObject()->findSlot( method ); + if ( slot == -1 ) + return; + + TQUObject o[ 1 ]; + m_extensionProxy->tqt_invoke( slot, o ); +} + +void KHTMLPartBrowserExtension::updateEditActions() +{ + if ( !m_editableFormWidget ) + { + enableAction( "cut", false ); + enableAction( "copy", false ); + enableAction( "paste", false ); + return; + } + + // ### duplicated from KonqMainWindow::slotClipboardDataChanged +#ifndef QT_NO_MIMECLIPBOARD // Handle minimalized versions of Qt Embedded + TQMimeSource *data = TQApplication::clipboard()->data(); + enableAction( "paste", data->provides( "text/plain" ) ); +#else + TQString data=TQApplication::clipboard()->text(); + enableAction( "paste", data.contains("://")); +#endif + bool hasSelection = false; + + if( m_editableFormWidget) { + if ( ::tqqt_cast(m_editableFormWidget)) + hasSelection = static_cast( &(*m_editableFormWidget) )->hasSelectedText(); + else if(::tqqt_cast(m_editableFormWidget)) + hasSelection = static_cast( &(*m_editableFormWidget) )->hasSelectedText(); + } + + enableAction( "copy", hasSelection ); + enableAction( "cut", hasSelection ); +} + +void KHTMLPartBrowserExtension::extensionProxyEditableWidgetFocused() { + editableWidgetFocused(); +} + +void KHTMLPartBrowserExtension::extensionProxyEditableWidgetBlurred() { + editableWidgetBlurred(); +} + +void KHTMLPartBrowserExtension::extensionProxyActionEnabled( const char *action, bool enable ) +{ + // only forward enableAction calls for actions we actually do forward + if ( strcmp( action, "cut" ) == 0 || + strcmp( action, "copy" ) == 0 || + strcmp( action, "paste" ) == 0 ) { + enableAction( action, enable ); + } +} + +void KHTMLPartBrowserExtension::reparseConfiguration() +{ + m_part->reparseConfiguration(); +} + +void KHTMLPartBrowserExtension::print() +{ + m_part->view()->print(); +} + +void KHTMLPartBrowserExtension::disableScrolling() +{ + TQScrollView *scrollView = m_part->view(); + if (scrollView) { + scrollView->setVScrollBarMode(TQScrollView::AlwaysOff); + scrollView->setHScrollBarMode(TQScrollView::AlwaysOff); + } +} + +class KHTMLPopupGUIClient::KHTMLPopupGUIClientPrivate +{ +public: + KHTMLPart *m_tdehtml; + KURL m_url; + KURL m_imageURL; + TQPixmap m_pixmap; + TQString m_suggestedFilename; +}; + + +KHTMLPopupGUIClient::KHTMLPopupGUIClient( KHTMLPart *tdehtml, const TQString &doc, const KURL &url ) + : TQObject( tdehtml ) +{ + d = new KHTMLPopupGUIClientPrivate; + d->m_tdehtml = tdehtml; + d->m_url = url; + bool isImage = false; + bool hasSelection = tdehtml->hasSelection(); + setInstance( tdehtml->instance() ); + + DOM::Element e; + e = tdehtml->nodeUnderMouse(); + + if ( !e.isNull() && (e.elementId() == ID_IMG || + (e.elementId() == ID_INPUT && !static_cast(e).src().isEmpty()))) + { + if (e.elementId() == ID_IMG) { + DOM::HTMLImageElementImpl *ie = static_cast(e.handle()); + tdehtml::RenderImage *ri = dynamic_cast(ie->renderer()); + if (ri && ri->contentObject()) { + d->m_suggestedFilename = static_cast(ri->contentObject())->suggestedFilename(); + } + } + isImage=true; + } + + if (hasSelection) + { + KAction* copyAction = KStdAction::copy( d->m_tdehtml->browserExtension(), TQT_SLOT( copy() ), actionCollection(), "copy" ); + copyAction->setText(i18n("&Copy Text")); + copyAction->setEnabled(d->m_tdehtml->browserExtension()->isActionEnabled( "copy" )); + actionCollection()->insert( tdehtml->actionCollection()->action( "selectAll" ) ); + + + // Fill search provider entries + TDEConfig config("kuriikwsfilterrc"); + config.setGroup("General"); + const TQString defaultEngine = config.readEntry("DefaultSearchEngine", "google"); + const char keywordDelimiter = config.readNumEntry("KeywordDelimiter", ':'); + + // search text + TQString selectedText = tdehtml->selectedText(); + selectedText.replace("&", "&&"); + if ( selectedText.length()>18 ) { + selectedText.truncate(15); + selectedText+="..."; + } + + // default search provider + KService::Ptr service = KService::serviceByDesktopPath(TQString("searchproviders/%1.desktop").arg(defaultEngine)); + + // search provider icon + TQPixmap icon; + KURIFilterData data; + TQStringList list; + data.setData( TQString("some keyword") ); + list << "kurisearchfilter" << "kuriikwsfilter"; + + TQString name; + if ( KURIFilter::self()->filterURI(data, list) ) + { + TQString iconPath = locate("cache", KMimeType::favIconForURL(data.uri()) + ".png"); + if ( iconPath.isEmpty() ) + icon = SmallIcon("find"); + else + icon = TQPixmap( iconPath ); + name = service->name(); + } + else + { + icon = SmallIcon("google"); + name = "Google"; + } + + // using .arg(foo, bar) instead of .arg(foo).arg(bar), as foo can contain %x + new KAction( i18n( "Search for '%1' with %2" ).arg( selectedText, name ), icon, 0, d->m_tdehtml->browserExtension(), + TQT_SLOT( searchProvider() ), actionCollection(), "searchProvider" ); + + // favorite search providers + TQStringList favoriteEngines; + favoriteEngines << "google" << "google_groups" << "google_news" << "webster" << "dmoz" << "wikipedia"; + favoriteEngines = config.readListEntry("FavoriteSearchEngines", favoriteEngines); + + if ( !favoriteEngines.isEmpty()) { + KActionMenu* providerList = new KActionMenu( i18n( "Search for '%1' with" ).arg( selectedText ), actionCollection(), "searchProviderList" ); + + TQStringList::ConstIterator it = favoriteEngines.begin(); + for ( ; it != favoriteEngines.end(); ++it ) { + if (*it==defaultEngine) + continue; + service = KService::serviceByDesktopPath(TQString("searchproviders/%1.desktop").arg(*it)); + if (!service) + continue; + const TQString searchProviderPrefix = *(service->property("Keys").toStringList().begin()) + keywordDelimiter; + data.setData( searchProviderPrefix + "some keyword" ); + + if ( KURIFilter::self()->filterURI(data, list) ) + { + TQString iconPath = locate("cache", KMimeType::favIconForURL(data.uri()) + ".png"); + if ( iconPath.isEmpty() ) + icon = SmallIcon("find"); + else + icon = TQPixmap( iconPath ); + name = service->name(); + + providerList->insert( new KAction( name, icon, 0, d->m_tdehtml->browserExtension(), + TQT_SLOT( searchProvider() ), actionCollection(), TQString( "searchProvider" + searchProviderPrefix ).latin1() ) ); + } + } + } + + + if ( selectedText.contains("://") && KURL(selectedText).isValid() ) + new KAction( i18n( "Open '%1'" ).arg( selectedText ), "window_new", 0, + d->m_tdehtml->browserExtension(), TQT_SLOT( openSelection() ), actionCollection(), "openSelection" ); + } + else if ( url.isEmpty() && !isImage ) + { + actionCollection()->insert( tdehtml->actionCollection()->action( "security" ) ); + actionCollection()->insert( tdehtml->actionCollection()->action( "setEncoding" ) ); + new KAction( i18n( "Stop Animations" ), 0, this, TQT_SLOT( slotStopAnimations() ), + actionCollection(), "stopanimations" ); + } + + if ( !url.isEmpty() ) + { + if (url.protocol() == "mailto") + { + new KAction( i18n( "Copy Email Address" ), 0, this, TQT_SLOT( slotCopyLinkLocation() ), + actionCollection(), "copylinklocation" ); + } + else + { + new KAction( i18n( "&Save Link As..." ), 0, this, TQT_SLOT( slotSaveLinkAs() ), + actionCollection(), "savelinkas" ); + new KAction( i18n( "Copy &Link Address" ), 0, this, TQT_SLOT( slotCopyLinkLocation() ), + actionCollection(), "copylinklocation" ); + } + } + + // frameset? -> add "Reload Frame" etc. + if (!hasSelection) + { + if ( tdehtml->parentPart() ) + { + new KAction( i18n( "Open in New &Window" ), "window_new", 0, this, TQT_SLOT( slotFrameInWindow() ), + actionCollection(), "frameinwindow" ); + new KAction( i18n( "Open in &This Window" ), 0, this, TQT_SLOT( slotFrameInTop() ), + actionCollection(), "frameintop" ); + new KAction( i18n( "Open in &New Tab" ), "tab_new", 0, this, TQT_SLOT( slotFrameInTab() ), + actionCollection(), "frameintab" ); + new KAction( i18n( "Reload Frame" ), 0, this, TQT_SLOT( slotReloadFrame() ), + actionCollection(), "reloadframe" ); + + if ( KHTMLFactory::defaultHTMLSettings()->isAdFilterEnabled() ) { + if ( tdehtml->d->m_frame->m_type == tdehtml::ChildFrame::IFrame ) + new KAction( i18n( "Block IFrame..." ), 0, this, TQT_SLOT( slotBlockIFrame() ), actionCollection(), "blockiframe" ); + } + + new KAction( i18n( "View Frame Source" ), 0, d->m_tdehtml, TQT_SLOT( slotViewDocumentSource() ), + actionCollection(), "viewFrameSource" ); + new KAction( i18n( "View Frame Information" ), 0, d->m_tdehtml, TQT_SLOT( slotViewPageInfo() ), actionCollection(), "viewFrameInfo" ); + // This one isn't in tdehtml_popupmenu.rc anymore, because Print isn't either, + // and because print frame is already in the toolbar and the menu. + // But leave this here, so that it's easy to read it. + new KAction( i18n( "Print Frame..." ), "frameprint", 0, d->m_tdehtml->browserExtension(), TQT_SLOT( print() ), actionCollection(), "printFrame" ); + new KAction( i18n( "Save &Frame As..." ), 0, d->m_tdehtml, TQT_SLOT( slotSaveFrame() ), actionCollection(), "saveFrame" ); + + actionCollection()->insert( tdehtml->parentPart()->actionCollection()->action( "viewDocumentSource" ) ); + actionCollection()->insert( tdehtml->parentPart()->actionCollection()->action( "viewPageInfo" ) ); + } else { + actionCollection()->insert( tdehtml->actionCollection()->action( "viewDocumentSource" ) ); + actionCollection()->insert( tdehtml->actionCollection()->action( "viewPageInfo" ) ); + } + } else if (isImage || !url.isEmpty()) { + actionCollection()->insert( tdehtml->actionCollection()->action( "viewDocumentSource" ) ); + actionCollection()->insert( tdehtml->actionCollection()->action( "viewPageInfo" ) ); + new KAction( i18n( "Stop Animations" ), 0, this, TQT_SLOT( slotStopAnimations() ), + actionCollection(), "stopanimations" ); + } + + if (isImage) + { + if ( e.elementId() == ID_IMG ) { + d->m_imageURL = KURL( static_cast( e ).src().string() ); + DOM::HTMLImageElementImpl *imageimpl = static_cast( e.handle() ); + Q_ASSERT(imageimpl); + if(imageimpl) // should be true always. right? + { + if(imageimpl->complete()) { + d->m_pixmap = imageimpl->currentPixmap(); + } + } + } + else + d->m_imageURL = KURL( static_cast( e ).src().string() ); + new KAction( i18n( "Save Image As..." ), 0, this, TQT_SLOT( slotSaveImageAs() ), + actionCollection(), "saveimageas" ); + new KAction( i18n( "Send Image..." ), 0, this, TQT_SLOT( slotSendImage() ), + actionCollection(), "sendimage" ); + + +#ifndef QT_NO_MIMECLIPBOARD + (new KAction( i18n( "Copy Image" ), 0, this, TQT_SLOT( slotCopyImage() ), + actionCollection(), "copyimage" ))->setEnabled(!d->m_pixmap.isNull()); +#endif + + if(d->m_pixmap.isNull()) { //fallback to image location if still loading the image. this will always be true if ifdef QT_NO_MIMECLIPBOARD + new KAction( i18n( "Copy Image Location" ), 0, this, TQT_SLOT( slotCopyImageLocation() ), + actionCollection(), "copyimagelocation" ); + } + + TQString name = KStringHandler::csqueeze(d->m_imageURL.fileName()+d->m_imageURL.query(), 25); + new KAction( i18n( "View Image (%1)" ).arg(d->m_suggestedFilename.isEmpty() ? name.replace("&", "&&") : d->m_suggestedFilename.replace("&", "&&")), 0, this, TQT_SLOT( slotViewImage() ), + actionCollection(), "viewimage" ); + + if (KHTMLFactory::defaultHTMLSettings()->isAdFilterEnabled()) + { + new KAction( i18n( "Block Image..." ), 0, this, TQT_SLOT( slotBlockImage() ), + actionCollection(), "blockimage" ); + + if (!d->m_imageURL.host().isEmpty() && + !d->m_imageURL.protocol().isEmpty()) + { + new KAction( i18n( "Block Images From %1" ).arg(d->m_imageURL.host()), 0, this, TQT_SLOT( slotBlockHost() ), + actionCollection(), "blockhost" ); + } + } + } + + setXML( doc ); + setDOMDocument( TQDomDocument(), true ); // ### HACK + + TQDomElement menu = domDocument().documentElement().namedItem( "Menu" ).toElement(); + + if ( actionCollection()->count() > 0 ) + menu.insertBefore( domDocument().createElement( "separator" ), menu.firstChild() ); +} + +KHTMLPopupGUIClient::~KHTMLPopupGUIClient() +{ + delete d; +} + +void KHTMLPopupGUIClient::slotSaveLinkAs() +{ + TDEIO::MetaData metaData; + metaData["referrer"] = d->m_tdehtml->referrer(); + saveURL( d->m_tdehtml->widget(), i18n( "Save Link As" ), d->m_url, metaData ); +} + +void KHTMLPopupGUIClient::slotSendImage() +{ + TQStringList urls; + urls.append( d->m_imageURL.url()); + TQString subject = d->m_imageURL.url(); + kapp->invokeMailer(TQString::null, TQString::null, TQString::null, subject, + TQString::null, //body + TQString::null, + urls); // attachments + + +} + +void KHTMLPopupGUIClient::slotSaveImageAs() +{ + TDEIO::MetaData metaData; + metaData["referrer"] = d->m_tdehtml->referrer(); + saveURL( d->m_tdehtml->widget(), i18n( "Save Image As" ), d->m_imageURL, metaData, TQString::null, 0, d->m_suggestedFilename ); +} + +void KHTMLPopupGUIClient::slotBlockHost() +{ + TQString name=d->m_imageURL.protocol()+"://"+d->m_imageURL.host()+"/*"; + KHTMLFactory::defaultHTMLSettings()->addAdFilter( name ); + d->m_tdehtml->reparseConfiguration(); +} + +void KHTMLPopupGUIClient::slotBlockImage() +{ + bool ok = false; + + TQString url = KInputDialog::getText( i18n("Add URL to Filter"), + i18n("Enter the URL:"), + d->m_imageURL.url(), + &ok); + if ( ok ) { + KHTMLFactory::defaultHTMLSettings()->addAdFilter( url ); + d->m_tdehtml->reparseConfiguration(); + } +} + +void KHTMLPopupGUIClient::slotBlockIFrame() +{ + bool ok = false; + TQString url = KInputDialog::getText( i18n( "Add URL to Filter"), + i18n("Enter the URL:"), + d->m_tdehtml->url().url(), + &ok ); + if ( ok ) { + KHTMLFactory::defaultHTMLSettings()->addAdFilter( url ); + d->m_tdehtml->reparseConfiguration(); + } +} + +void KHTMLPopupGUIClient::slotCopyLinkLocation() +{ + KURL safeURL(d->m_url); + safeURL.setPass(TQString::null); +#ifndef QT_NO_MIMECLIPBOARD + // Set it in both the mouse selection and in the clipboard + KURL::List lst; + lst.append( safeURL ); + TQApplication::clipboard()->setData( new KURLDrag( lst ), TQClipboard::Clipboard ); + TQApplication::clipboard()->setData( new KURLDrag( lst ), TQClipboard::Selection ); +#else + TQApplication::clipboard()->setText( safeURL.url() ); //FIXME(E): Handle multiple entries +#endif +} + +void KHTMLPopupGUIClient::slotStopAnimations() +{ + d->m_tdehtml->stopAnimations(); +} + +void KHTMLPopupGUIClient::slotCopyImage() +{ +#ifndef QT_NO_MIMECLIPBOARD + KURL safeURL(d->m_imageURL); + safeURL.setPass(TQString::null); + + KURL::List lst; + lst.append( safeURL ); + KMultipleDrag *drag = new KMultipleDrag(d->m_tdehtml->view(), "Image"); + + drag->addDragObject( new TQImageDrag(d->m_pixmap.convertToImage()) ); + drag->addDragObject( new KURLDrag(lst, d->m_tdehtml->view(), "Image URL") ); + + // Set it in both the mouse selection and in the clipboard + TQApplication::clipboard()->setData( drag, TQClipboard::Clipboard ); + TQApplication::clipboard()->setData( new KURLDrag(lst), TQClipboard::Selection ); +#else + kdDebug() << "slotCopyImage called when the clipboard does not support this. This should not be possible." << endl; +#endif +} + +void KHTMLPopupGUIClient::slotCopyImageLocation() +{ + KURL safeURL(d->m_imageURL); + safeURL.setPass(TQString::null); +#ifndef QT_NO_MIMECLIPBOARD + // Set it in both the mouse selection and in the clipboard + KURL::List lst; + lst.append( safeURL ); + TQApplication::clipboard()->setData( new KURLDrag( lst ), TQClipboard::Clipboard ); + TQApplication::clipboard()->setData( new KURLDrag( lst ), TQClipboard::Selection ); +#else + TQApplication::clipboard()->setText( safeURL.url() ); //FIXME(E): Handle multiple entries +#endif +} + +void KHTMLPopupGUIClient::slotViewImage() +{ + d->m_tdehtml->browserExtension()->createNewWindow(d->m_imageURL); +} + +void KHTMLPopupGUIClient::slotReloadFrame() +{ + KParts::URLArgs args( d->m_tdehtml->browserExtension()->urlArgs() ); + args.reload = true; + args.metaData()["referrer"] = d->m_tdehtml->pageReferrer(); + // reload document + d->m_tdehtml->closeURL(); + d->m_tdehtml->browserExtension()->setURLArgs( args ); + d->m_tdehtml->openURL( d->m_tdehtml->url() ); +} + +void KHTMLPopupGUIClient::slotFrameInWindow() +{ + KParts::URLArgs args( d->m_tdehtml->browserExtension()->urlArgs() ); + args.metaData()["referrer"] = d->m_tdehtml->pageReferrer(); + args.metaData()["forcenewwindow"] = "true"; + emit d->m_tdehtml->browserExtension()->createNewWindow( d->m_tdehtml->url(), args ); +} + +void KHTMLPopupGUIClient::slotFrameInTop() +{ + KParts::URLArgs args( d->m_tdehtml->browserExtension()->urlArgs() ); + args.metaData()["referrer"] = d->m_tdehtml->pageReferrer(); + args.frameName = "_top"; + emit d->m_tdehtml->browserExtension()->openURLRequest( d->m_tdehtml->url(), args ); +} + +void KHTMLPopupGUIClient::slotFrameInTab() +{ + KParts::URLArgs args( d->m_tdehtml->browserExtension()->urlArgs() ); + args.metaData()["referrer"] = d->m_tdehtml->pageReferrer(); + args.setNewTab(true); + emit d->m_tdehtml->browserExtension()->createNewWindow( d->m_tdehtml->url(), args ); +} + +void KHTMLPopupGUIClient::saveURL( TQWidget *parent, const TQString &caption, + const KURL &url, + const TQMap &metadata, + const TQString &filter, long cacheId, + const TQString & suggestedFilename ) +{ + TQString name = TQString::fromLatin1( "index.html" ); + if ( !suggestedFilename.isEmpty() ) + name = suggestedFilename; + else if ( !url.fileName().isEmpty() ) + name = url.fileName(); + + KURL destURL; + int query; + do { + query = KMessageBox::Yes; + destURL = KFileDialog::getSaveURL( name, filter, parent, caption ); + if( destURL.isLocalFile() ) + { + TQFileInfo info( destURL.path() ); + if( info.exists() ) { + // TODO: use TDEIO::RenameDlg (shows more information) + query = KMessageBox::warningContinueCancel( parent, i18n( "A file named \"%1\" already exists. " "Are you sure you want to overwrite it?" ).arg( info.fileName() ), i18n( "Overwrite File?" ), i18n( "Overwrite" ) ); + } + } + } while ( query == KMessageBox::Cancel ); + + if ( destURL.isValid() ) + saveURL(url, destURL, metadata, cacheId); +} + +void KHTMLPopupGUIClient::saveURL( const KURL &url, const KURL &destURL, + const TQMap &metadata, + long cacheId ) +{ + if ( destURL.isValid() ) + { + bool saved = false; + if (KHTMLPageCache::self()->isComplete(cacheId)) + { + if (destURL.isLocalFile()) + { + KSaveFile destFile(destURL.path()); + if (destFile.status() == 0) + { + KHTMLPageCache::self()->saveData(cacheId, destFile.dataStream()); + saved = true; + } + } + else + { + // save to temp file, then move to final destination. + KTempFile destFile; + if (destFile.status() == 0) + { + KHTMLPageCache::self()->saveData(cacheId, destFile.dataStream()); + destFile.close(); + KURL url2 = KURL(); + url2.setPath(destFile.name()); + TDEIO::file_move(url2, destURL, -1, true /*overwrite*/); + saved = true; + } + } + } + if(!saved) + { + // DownloadManager <-> konqueror integration + // find if the integration is enabled + // the empty key means no integration + // only use download manager for non-local urls! + bool downloadViaKIO = true; + if ( !url.isLocalFile() ) + { + TDEConfig cfg("konquerorrc", false, false); + cfg.setGroup("HTML Settings"); + TQString downloadManger = cfg.readPathEntry("DownloadManager"); + if (!downloadManger.isEmpty()) + { + // then find the download manager location + kdDebug(1000) << "Using: "<setMetaData(metadata); + job->addMetaData("MaxCacheSize", "0"); // Don't store in http cache. + job->addMetaData("cache", "cache"); // Use entry from cache if available. + job->setAutoErrorHandlingEnabled( true ); + } + } //end if(!saved) + } +} + +KHTMLPartBrowserHostExtension::KHTMLPartBrowserHostExtension( KHTMLPart *part ) +: KParts::BrowserHostExtension( part ) +{ + m_part = part; +} + +KHTMLPartBrowserHostExtension::~KHTMLPartBrowserHostExtension() +{ +} + +TQStringList KHTMLPartBrowserHostExtension::frameNames() const +{ + return m_part->frameNames(); +} + +const TQPtrList KHTMLPartBrowserHostExtension::frames() const +{ + return m_part->frames(); +} + +bool KHTMLPartBrowserHostExtension::openURLInFrame( const KURL &url, const KParts::URLArgs &urlArgs ) +{ + return m_part->openURLInFrame( url, urlArgs ); +} + +void KHTMLPartBrowserHostExtension::virtual_hook( int id, void *data ) +{ + if (id == VIRTUAL_FIND_FRAME_PARENT) + { + FindFrameParentParams *param = static_cast(data); + KHTMLPart *parentPart = m_part->findFrameParent(param->callingPart, param->frame); + if (parentPart) + param->parent = parentPart->browserHostExtension(); + return; + } + BrowserHostExtension::virtual_hook( id, data ); +} + + +// defined in tdehtml_part.cpp +extern const int KDE_NO_EXPORT fastZoomSizes[]; +extern const int KDE_NO_EXPORT fastZoomSizeCount; + +// BCI: remove in KDE 4 +KHTMLZoomFactorAction::KHTMLZoomFactorAction( KHTMLPart *part, bool direction, const TQString &text, const TQString &icon, const TQObject *receiver, const char *slot, TQObject *parent, const char *name ) + : KAction( text, icon, 0, receiver, slot, parent, name ) +{ + init(part, direction); +} + +KHTMLZoomFactorAction::KHTMLZoomFactorAction( KHTMLPart *part, bool direction, const TQString &text, const TQString &icon, const KShortcut &cut, const TQObject *receiver, const char *slot, TQObject *parent, const char *name ) + : KAction( text, icon, cut, receiver, slot, parent, name ) +{ + init(part, direction); +} + +void KHTMLZoomFactorAction::init(KHTMLPart *part, bool direction) +{ + m_direction = direction; + m_part = part; + + m_popup = new TQPopupMenu; + // xgettext: no-c-format + m_popup->insertItem( i18n( "Default Font Size (100%)" ) ); + + int m = m_direction ? 1 : -1; + int ofs = fastZoomSizeCount / 2; // take index of 100% + + // this only works if there is an odd number of elements in fastZoomSizes[] + for ( int i = m; i != m*(ofs+1); i += m ) + { + int num = i * m; + TQString numStr = TQString::number( num ); + if ( num > 0 ) numStr.prepend( '+' ); + + // xgettext: no-c-format + m_popup->insertItem( i18n( "%1%" ).arg( fastZoomSizes[ofs + i] ) ); + } + + connect( m_popup, TQT_SIGNAL( activated( int ) ), this, TQT_SLOT( slotActivated( int ) ) ); +} + +KHTMLZoomFactorAction::~KHTMLZoomFactorAction() +{ + delete m_popup; +} + +int KHTMLZoomFactorAction::plug( TQWidget *w, int index ) +{ + int containerId = KAction::plug( w, index ); + if ( containerId == -1 || !w->inherits( "KToolBar" ) ) + return containerId; + + KToolBarButton *button = static_cast( w )->getButton( itemId( containerId ) ); + if ( !button ) + return containerId; + + button->setDelayedPopup( m_popup ); + return containerId; +} + +void KHTMLZoomFactorAction::slotActivated( int id ) +{ + int idx = m_popup->indexOf( id ); + + if (idx == 0) + m_part->setZoomFactor(100); + else + m_part->setZoomFactor(fastZoomSizes[fastZoomSizeCount/2 + (m_direction ? 1 : -1)*idx]); +} + +#include "tdehtml_ext.moc" + -- cgit v1.2.1 From 5159cd2beb2e87806a5b54e9991b7895285c9d3e Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Sun, 27 Jan 2013 01:04:16 -0600 Subject: Rename a number of libraries and executables to avoid conflicts with KDE4 --- tdehtml/tdehtml_ext.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tdehtml/tdehtml_ext.cpp') diff --git a/tdehtml/tdehtml_ext.cpp b/tdehtml/tdehtml_ext.cpp index 62a5293c1..4127e7762 100644 --- a/tdehtml/tdehtml_ext.cpp +++ b/tdehtml/tdehtml_ext.cpp @@ -45,8 +45,8 @@ #include #include -#include -#include +#include +#include #include #include #include -- cgit v1.2.1 From 7427e438358d44c37e3c8b0a9cfbb225ffd60e79 Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Sun, 27 Jan 2013 15:54:26 -0600 Subject: Rename KHTML and kiobuffer --- tdehtml/tdehtml_ext.cpp | 134 ++++++++++++++++++++++++------------------------ 1 file changed, 67 insertions(+), 67 deletions(-) (limited to 'tdehtml/tdehtml_ext.cpp') diff --git a/tdehtml/tdehtml_ext.cpp b/tdehtml/tdehtml_ext.cpp index 4127e7762..5803b1ca3 100644 --- a/tdehtml/tdehtml_ext.cpp +++ b/tdehtml/tdehtml_ext.cpp @@ -70,7 +70,7 @@ #include "tdehtmlpart_p.h" -KHTMLPartBrowserExtension::KHTMLPartBrowserExtension( KHTMLPart *parent, const char *name ) +TDEHTMLPartBrowserExtension::TDEHTMLPartBrowserExtension( TDEHTMLPart *parent, const char *name ) : KParts::BrowserExtension( parent, name ) { m_part = parent; @@ -83,29 +83,29 @@ KHTMLPartBrowserExtension::KHTMLPartBrowserExtension( KHTMLPart *parent, const c m_connectedToClipboard = false; } -int KHTMLPartBrowserExtension::xOffset() +int TDEHTMLPartBrowserExtension::xOffset() { return m_part->view()->contentsX(); } -int KHTMLPartBrowserExtension::yOffset() +int TDEHTMLPartBrowserExtension::yOffset() { return m_part->view()->contentsY(); } -void KHTMLPartBrowserExtension::saveState( TQDataStream &stream ) +void TDEHTMLPartBrowserExtension::saveState( TQDataStream &stream ) { //kdDebug( 6050 ) << "saveState!" << endl; m_part->saveState( stream ); } -void KHTMLPartBrowserExtension::restoreState( TQDataStream &stream ) +void TDEHTMLPartBrowserExtension::restoreState( TQDataStream &stream ) { //kdDebug( 6050 ) << "restoreState!" << endl; m_part->restoreState( stream ); } -void KHTMLPartBrowserExtension::editableWidgetFocused( TQWidget *widget ) +void TDEHTMLPartBrowserExtension::editableWidgetFocused( TQWidget *widget ) { m_editableFormWidget = widget; updateEditActions(); @@ -124,7 +124,7 @@ void KHTMLPartBrowserExtension::editableWidgetFocused( TQWidget *widget ) editableWidgetFocused(); } -void KHTMLPartBrowserExtension::editableWidgetBlurred( TQWidget * /*widget*/ ) +void TDEHTMLPartBrowserExtension::editableWidgetBlurred( TQWidget * /*widget*/ ) { TQWidget *oldWidget = m_editableFormWidget; @@ -150,13 +150,13 @@ void KHTMLPartBrowserExtension::editableWidgetBlurred( TQWidget * /*widget*/ ) editableWidgetBlurred(); } -void KHTMLPartBrowserExtension::setExtensionProxy( KParts::BrowserExtension *proxy ) +void TDEHTMLPartBrowserExtension::setExtensionProxy( KParts::BrowserExtension *proxy ) { if ( m_extensionProxy ) { disconnect( m_extensionProxy, TQT_SIGNAL( enableAction( const char *, bool ) ), this, TQT_SLOT( extensionProxyActionEnabled( const char *, bool ) ) ); - if ( m_extensionProxy->inherits( "KHTMLPartBrowserExtension" ) ) + if ( m_extensionProxy->inherits( "TDEHTMLPartBrowserExtension" ) ) { disconnect( m_extensionProxy, TQT_SIGNAL( editableWidgetFocused() ), this, TQT_SLOT( extensionProxyEditableWidgetFocused() ) ); @@ -171,7 +171,7 @@ void KHTMLPartBrowserExtension::setExtensionProxy( KParts::BrowserExtension *pro { connect( m_extensionProxy, TQT_SIGNAL( enableAction( const char *, bool ) ), this, TQT_SLOT( extensionProxyActionEnabled( const char *, bool ) ) ); - if ( m_extensionProxy->inherits( "KHTMLPartBrowserExtension" ) ) + if ( m_extensionProxy->inherits( "TDEHTMLPartBrowserExtension" ) ) { connect( m_extensionProxy, TQT_SIGNAL( editableWidgetFocused() ), this, TQT_SLOT( extensionProxyEditableWidgetFocused() ) ); @@ -190,7 +190,7 @@ void KHTMLPartBrowserExtension::setExtensionProxy( KParts::BrowserExtension *pro } } -void KHTMLPartBrowserExtension::cut() +void TDEHTMLPartBrowserExtension::cut() { if ( m_extensionProxy ) { @@ -207,7 +207,7 @@ void KHTMLPartBrowserExtension::cut() static_cast( &(*m_editableFormWidget) )->cut(); } -void KHTMLPartBrowserExtension::copy() +void TDEHTMLPartBrowserExtension::copy() { if ( m_extensionProxy ) { @@ -215,7 +215,7 @@ void KHTMLPartBrowserExtension::copy() return; } - kdDebug( 6050 ) << "************! KHTMLPartBrowserExtension::copy()" << endl; + kdDebug( 6050 ) << "************! TDEHTMLPartBrowserExtension::copy()" << endl; if ( !m_editableFormWidget ) { // get selected text and paste to the clipboard @@ -261,7 +261,7 @@ void KHTMLPartBrowserExtension::copy() } } -void KHTMLPartBrowserExtension::searchProvider() +void TDEHTMLPartBrowserExtension::searchProvider() { // action name is of form "previewProvider[:]" const TQString searchProviderPrefix = TQString( TQT_TQOBJECT_CONST(sender())->name() ).mid( 14 ); @@ -285,7 +285,7 @@ void KHTMLPartBrowserExtension::searchProvider() emit m_part->browserExtension()->openURLRequest( data.uri(), args ); } -void KHTMLPartBrowserExtension::openSelection() +void TDEHTMLPartBrowserExtension::openSelection() { KParts::URLArgs args; args.frameName = "_blank"; @@ -293,7 +293,7 @@ void KHTMLPartBrowserExtension::openSelection() emit m_part->browserExtension()->openURLRequest( m_part->selectedText(), args ); } -void KHTMLPartBrowserExtension::paste() +void TDEHTMLPartBrowserExtension::paste() { if ( m_extensionProxy ) { @@ -310,7 +310,7 @@ void KHTMLPartBrowserExtension::paste() static_cast( &(*m_editableFormWidget) )->paste(); } -void KHTMLPartBrowserExtension::callExtensionProxyMethod( const char *method ) +void TDEHTMLPartBrowserExtension::callExtensionProxyMethod( const char *method ) { if ( !m_extensionProxy ) return; @@ -323,7 +323,7 @@ void KHTMLPartBrowserExtension::callExtensionProxyMethod( const char *method ) m_extensionProxy->tqt_invoke( slot, o ); } -void KHTMLPartBrowserExtension::updateEditActions() +void TDEHTMLPartBrowserExtension::updateEditActions() { if ( !m_editableFormWidget ) { @@ -354,15 +354,15 @@ void KHTMLPartBrowserExtension::updateEditActions() enableAction( "cut", hasSelection ); } -void KHTMLPartBrowserExtension::extensionProxyEditableWidgetFocused() { +void TDEHTMLPartBrowserExtension::extensionProxyEditableWidgetFocused() { editableWidgetFocused(); } -void KHTMLPartBrowserExtension::extensionProxyEditableWidgetBlurred() { +void TDEHTMLPartBrowserExtension::extensionProxyEditableWidgetBlurred() { editableWidgetBlurred(); } -void KHTMLPartBrowserExtension::extensionProxyActionEnabled( const char *action, bool enable ) +void TDEHTMLPartBrowserExtension::extensionProxyActionEnabled( const char *action, bool enable ) { // only forward enableAction calls for actions we actually do forward if ( strcmp( action, "cut" ) == 0 || @@ -372,17 +372,17 @@ void KHTMLPartBrowserExtension::extensionProxyActionEnabled( const char *action, } } -void KHTMLPartBrowserExtension::reparseConfiguration() +void TDEHTMLPartBrowserExtension::reparseConfiguration() { m_part->reparseConfiguration(); } -void KHTMLPartBrowserExtension::print() +void TDEHTMLPartBrowserExtension::print() { m_part->view()->print(); } -void KHTMLPartBrowserExtension::disableScrolling() +void TDEHTMLPartBrowserExtension::disableScrolling() { TQScrollView *scrollView = m_part->view(); if (scrollView) { @@ -391,10 +391,10 @@ void KHTMLPartBrowserExtension::disableScrolling() } } -class KHTMLPopupGUIClient::KHTMLPopupGUIClientPrivate +class TDEHTMLPopupGUIClient::TDEHTMLPopupGUIClientPrivate { public: - KHTMLPart *m_tdehtml; + TDEHTMLPart *m_tdehtml; KURL m_url; KURL m_imageURL; TQPixmap m_pixmap; @@ -402,10 +402,10 @@ public: }; -KHTMLPopupGUIClient::KHTMLPopupGUIClient( KHTMLPart *tdehtml, const TQString &doc, const KURL &url ) +TDEHTMLPopupGUIClient::TDEHTMLPopupGUIClient( TDEHTMLPart *tdehtml, const TQString &doc, const KURL &url ) : TQObject( tdehtml ) { - d = new KHTMLPopupGUIClientPrivate; + d = new TDEHTMLPopupGUIClientPrivate; d->m_tdehtml = tdehtml; d->m_url = url; bool isImage = false; @@ -556,7 +556,7 @@ KHTMLPopupGUIClient::KHTMLPopupGUIClient( KHTMLPart *tdehtml, const TQString &do new KAction( i18n( "Reload Frame" ), 0, this, TQT_SLOT( slotReloadFrame() ), actionCollection(), "reloadframe" ); - if ( KHTMLFactory::defaultHTMLSettings()->isAdFilterEnabled() ) { + if ( TDEHTMLFactory::defaultHTMLSettings()->isAdFilterEnabled() ) { if ( tdehtml->d->m_frame->m_type == tdehtml::ChildFrame::IFrame ) new KAction( i18n( "Block IFrame..." ), 0, this, TQT_SLOT( slotBlockIFrame() ), actionCollection(), "blockiframe" ); } @@ -618,7 +618,7 @@ KHTMLPopupGUIClient::KHTMLPopupGUIClient( KHTMLPart *tdehtml, const TQString &do new KAction( i18n( "View Image (%1)" ).arg(d->m_suggestedFilename.isEmpty() ? name.replace("&", "&&") : d->m_suggestedFilename.replace("&", "&&")), 0, this, TQT_SLOT( slotViewImage() ), actionCollection(), "viewimage" ); - if (KHTMLFactory::defaultHTMLSettings()->isAdFilterEnabled()) + if (TDEHTMLFactory::defaultHTMLSettings()->isAdFilterEnabled()) { new KAction( i18n( "Block Image..." ), 0, this, TQT_SLOT( slotBlockImage() ), actionCollection(), "blockimage" ); @@ -641,19 +641,19 @@ KHTMLPopupGUIClient::KHTMLPopupGUIClient( KHTMLPart *tdehtml, const TQString &do menu.insertBefore( domDocument().createElement( "separator" ), menu.firstChild() ); } -KHTMLPopupGUIClient::~KHTMLPopupGUIClient() +TDEHTMLPopupGUIClient::~TDEHTMLPopupGUIClient() { delete d; } -void KHTMLPopupGUIClient::slotSaveLinkAs() +void TDEHTMLPopupGUIClient::slotSaveLinkAs() { TDEIO::MetaData metaData; metaData["referrer"] = d->m_tdehtml->referrer(); saveURL( d->m_tdehtml->widget(), i18n( "Save Link As" ), d->m_url, metaData ); } -void KHTMLPopupGUIClient::slotSendImage() +void TDEHTMLPopupGUIClient::slotSendImage() { TQStringList urls; urls.append( d->m_imageURL.url()); @@ -666,21 +666,21 @@ void KHTMLPopupGUIClient::slotSendImage() } -void KHTMLPopupGUIClient::slotSaveImageAs() +void TDEHTMLPopupGUIClient::slotSaveImageAs() { TDEIO::MetaData metaData; metaData["referrer"] = d->m_tdehtml->referrer(); saveURL( d->m_tdehtml->widget(), i18n( "Save Image As" ), d->m_imageURL, metaData, TQString::null, 0, d->m_suggestedFilename ); } -void KHTMLPopupGUIClient::slotBlockHost() +void TDEHTMLPopupGUIClient::slotBlockHost() { TQString name=d->m_imageURL.protocol()+"://"+d->m_imageURL.host()+"/*"; - KHTMLFactory::defaultHTMLSettings()->addAdFilter( name ); + TDEHTMLFactory::defaultHTMLSettings()->addAdFilter( name ); d->m_tdehtml->reparseConfiguration(); } -void KHTMLPopupGUIClient::slotBlockImage() +void TDEHTMLPopupGUIClient::slotBlockImage() { bool ok = false; @@ -689,12 +689,12 @@ void KHTMLPopupGUIClient::slotBlockImage() d->m_imageURL.url(), &ok); if ( ok ) { - KHTMLFactory::defaultHTMLSettings()->addAdFilter( url ); + TDEHTMLFactory::defaultHTMLSettings()->addAdFilter( url ); d->m_tdehtml->reparseConfiguration(); } } -void KHTMLPopupGUIClient::slotBlockIFrame() +void TDEHTMLPopupGUIClient::slotBlockIFrame() { bool ok = false; TQString url = KInputDialog::getText( i18n( "Add URL to Filter"), @@ -702,12 +702,12 @@ void KHTMLPopupGUIClient::slotBlockIFrame() d->m_tdehtml->url().url(), &ok ); if ( ok ) { - KHTMLFactory::defaultHTMLSettings()->addAdFilter( url ); + TDEHTMLFactory::defaultHTMLSettings()->addAdFilter( url ); d->m_tdehtml->reparseConfiguration(); } } -void KHTMLPopupGUIClient::slotCopyLinkLocation() +void TDEHTMLPopupGUIClient::slotCopyLinkLocation() { KURL safeURL(d->m_url); safeURL.setPass(TQString::null); @@ -722,12 +722,12 @@ void KHTMLPopupGUIClient::slotCopyLinkLocation() #endif } -void KHTMLPopupGUIClient::slotStopAnimations() +void TDEHTMLPopupGUIClient::slotStopAnimations() { d->m_tdehtml->stopAnimations(); } -void KHTMLPopupGUIClient::slotCopyImage() +void TDEHTMLPopupGUIClient::slotCopyImage() { #ifndef QT_NO_MIMECLIPBOARD KURL safeURL(d->m_imageURL); @@ -748,7 +748,7 @@ void KHTMLPopupGUIClient::slotCopyImage() #endif } -void KHTMLPopupGUIClient::slotCopyImageLocation() +void TDEHTMLPopupGUIClient::slotCopyImageLocation() { KURL safeURL(d->m_imageURL); safeURL.setPass(TQString::null); @@ -763,12 +763,12 @@ void KHTMLPopupGUIClient::slotCopyImageLocation() #endif } -void KHTMLPopupGUIClient::slotViewImage() +void TDEHTMLPopupGUIClient::slotViewImage() { d->m_tdehtml->browserExtension()->createNewWindow(d->m_imageURL); } -void KHTMLPopupGUIClient::slotReloadFrame() +void TDEHTMLPopupGUIClient::slotReloadFrame() { KParts::URLArgs args( d->m_tdehtml->browserExtension()->urlArgs() ); args.reload = true; @@ -779,7 +779,7 @@ void KHTMLPopupGUIClient::slotReloadFrame() d->m_tdehtml->openURL( d->m_tdehtml->url() ); } -void KHTMLPopupGUIClient::slotFrameInWindow() +void TDEHTMLPopupGUIClient::slotFrameInWindow() { KParts::URLArgs args( d->m_tdehtml->browserExtension()->urlArgs() ); args.metaData()["referrer"] = d->m_tdehtml->pageReferrer(); @@ -787,7 +787,7 @@ void KHTMLPopupGUIClient::slotFrameInWindow() emit d->m_tdehtml->browserExtension()->createNewWindow( d->m_tdehtml->url(), args ); } -void KHTMLPopupGUIClient::slotFrameInTop() +void TDEHTMLPopupGUIClient::slotFrameInTop() { KParts::URLArgs args( d->m_tdehtml->browserExtension()->urlArgs() ); args.metaData()["referrer"] = d->m_tdehtml->pageReferrer(); @@ -795,7 +795,7 @@ void KHTMLPopupGUIClient::slotFrameInTop() emit d->m_tdehtml->browserExtension()->openURLRequest( d->m_tdehtml->url(), args ); } -void KHTMLPopupGUIClient::slotFrameInTab() +void TDEHTMLPopupGUIClient::slotFrameInTab() { KParts::URLArgs args( d->m_tdehtml->browserExtension()->urlArgs() ); args.metaData()["referrer"] = d->m_tdehtml->pageReferrer(); @@ -803,7 +803,7 @@ void KHTMLPopupGUIClient::slotFrameInTab() emit d->m_tdehtml->browserExtension()->createNewWindow( d->m_tdehtml->url(), args ); } -void KHTMLPopupGUIClient::saveURL( TQWidget *parent, const TQString &caption, +void TDEHTMLPopupGUIClient::saveURL( TQWidget *parent, const TQString &caption, const KURL &url, const TQMap &metadata, const TQString &filter, long cacheId, @@ -834,21 +834,21 @@ void KHTMLPopupGUIClient::saveURL( TQWidget *parent, const TQString &caption, saveURL(url, destURL, metadata, cacheId); } -void KHTMLPopupGUIClient::saveURL( const KURL &url, const KURL &destURL, +void TDEHTMLPopupGUIClient::saveURL( const KURL &url, const KURL &destURL, const TQMap &metadata, long cacheId ) { if ( destURL.isValid() ) { bool saved = false; - if (KHTMLPageCache::self()->isComplete(cacheId)) + if (TDEHTMLPageCache::self()->isComplete(cacheId)) { if (destURL.isLocalFile()) { KSaveFile destFile(destURL.path()); if (destFile.status() == 0) { - KHTMLPageCache::self()->saveData(cacheId, destFile.dataStream()); + TDEHTMLPageCache::self()->saveData(cacheId, destFile.dataStream()); saved = true; } } @@ -858,7 +858,7 @@ void KHTMLPopupGUIClient::saveURL( const KURL &url, const KURL &destURL, KTempFile destFile; if (destFile.status() == 0) { - KHTMLPageCache::self()->saveData(cacheId, destFile.dataStream()); + TDEHTMLPageCache::self()->saveData(cacheId, destFile.dataStream()); destFile.close(); KURL url2 = KURL(); url2.setPath(destFile.name()); @@ -917,37 +917,37 @@ void KHTMLPopupGUIClient::saveURL( const KURL &url, const KURL &destURL, } } -KHTMLPartBrowserHostExtension::KHTMLPartBrowserHostExtension( KHTMLPart *part ) +TDEHTMLPartBrowserHostExtension::TDEHTMLPartBrowserHostExtension( TDEHTMLPart *part ) : KParts::BrowserHostExtension( part ) { m_part = part; } -KHTMLPartBrowserHostExtension::~KHTMLPartBrowserHostExtension() +TDEHTMLPartBrowserHostExtension::~TDEHTMLPartBrowserHostExtension() { } -TQStringList KHTMLPartBrowserHostExtension::frameNames() const +TQStringList TDEHTMLPartBrowserHostExtension::frameNames() const { return m_part->frameNames(); } -const TQPtrList KHTMLPartBrowserHostExtension::frames() const +const TQPtrList TDEHTMLPartBrowserHostExtension::frames() const { return m_part->frames(); } -bool KHTMLPartBrowserHostExtension::openURLInFrame( const KURL &url, const KParts::URLArgs &urlArgs ) +bool TDEHTMLPartBrowserHostExtension::openURLInFrame( const KURL &url, const KParts::URLArgs &urlArgs ) { return m_part->openURLInFrame( url, urlArgs ); } -void KHTMLPartBrowserHostExtension::virtual_hook( int id, void *data ) +void TDEHTMLPartBrowserHostExtension::virtual_hook( int id, void *data ) { if (id == VIRTUAL_FIND_FRAME_PARENT) { FindFrameParentParams *param = static_cast(data); - KHTMLPart *parentPart = m_part->findFrameParent(param->callingPart, param->frame); + TDEHTMLPart *parentPart = m_part->findFrameParent(param->callingPart, param->frame); if (parentPart) param->parent = parentPart->browserHostExtension(); return; @@ -961,19 +961,19 @@ extern const int KDE_NO_EXPORT fastZoomSizes[]; extern const int KDE_NO_EXPORT fastZoomSizeCount; // BCI: remove in KDE 4 -KHTMLZoomFactorAction::KHTMLZoomFactorAction( KHTMLPart *part, bool direction, const TQString &text, const TQString &icon, const TQObject *receiver, const char *slot, TQObject *parent, const char *name ) +TDEHTMLZoomFactorAction::TDEHTMLZoomFactorAction( TDEHTMLPart *part, bool direction, const TQString &text, const TQString &icon, const TQObject *receiver, const char *slot, TQObject *parent, const char *name ) : KAction( text, icon, 0, receiver, slot, parent, name ) { init(part, direction); } -KHTMLZoomFactorAction::KHTMLZoomFactorAction( KHTMLPart *part, bool direction, const TQString &text, const TQString &icon, const KShortcut &cut, const TQObject *receiver, const char *slot, TQObject *parent, const char *name ) +TDEHTMLZoomFactorAction::TDEHTMLZoomFactorAction( TDEHTMLPart *part, bool direction, const TQString &text, const TQString &icon, const KShortcut &cut, const TQObject *receiver, const char *slot, TQObject *parent, const char *name ) : KAction( text, icon, cut, receiver, slot, parent, name ) { init(part, direction); } -void KHTMLZoomFactorAction::init(KHTMLPart *part, bool direction) +void TDEHTMLZoomFactorAction::init(TDEHTMLPart *part, bool direction) { m_direction = direction; m_part = part; @@ -999,12 +999,12 @@ void KHTMLZoomFactorAction::init(KHTMLPart *part, bool direction) connect( m_popup, TQT_SIGNAL( activated( int ) ), this, TQT_SLOT( slotActivated( int ) ) ); } -KHTMLZoomFactorAction::~KHTMLZoomFactorAction() +TDEHTMLZoomFactorAction::~TDEHTMLZoomFactorAction() { delete m_popup; } -int KHTMLZoomFactorAction::plug( TQWidget *w, int index ) +int TDEHTMLZoomFactorAction::plug( TQWidget *w, int index ) { int containerId = KAction::plug( w, index ); if ( containerId == -1 || !w->inherits( "KToolBar" ) ) @@ -1018,7 +1018,7 @@ int KHTMLZoomFactorAction::plug( TQWidget *w, int index ) return containerId; } -void KHTMLZoomFactorAction::slotActivated( int id ) +void TDEHTMLZoomFactorAction::slotActivated( int id ) { int idx = m_popup->indexOf( id ); -- cgit v1.2.1 From d3afa6baf98ef5ac191996cc9b909ff9074c168c Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Thu, 31 Jan 2013 13:28:26 -0600 Subject: Rename KStandard for enhanced compatibility with KDE4 --- tdehtml/tdehtml_ext.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tdehtml/tdehtml_ext.cpp') diff --git a/tdehtml/tdehtml_ext.cpp b/tdehtml/tdehtml_ext.cpp index 5803b1ca3..62c93079e 100644 --- a/tdehtml/tdehtml_ext.cpp +++ b/tdehtml/tdehtml_ext.cpp @@ -883,7 +883,7 @@ void TDEHTMLPopupGUIClient::saveURL( const KURL &url, const KURL &destURL, { // then find the download manager location kdDebug(1000) << "Using: "< Date: Fri, 1 Feb 2013 15:13:01 -0600 Subject: Rename a number of classes to enhance compatibility with KDE4 --- tdehtml/tdehtml_ext.cpp | 64 ++++++++++++++++++++++++------------------------- 1 file changed, 32 insertions(+), 32 deletions(-) (limited to 'tdehtml/tdehtml_ext.cpp') diff --git a/tdehtml/tdehtml_ext.cpp b/tdehtml/tdehtml_ext.cpp index 62c93079e..72576e91e 100644 --- a/tdehtml/tdehtml_ext.cpp +++ b/tdehtml/tdehtml_ext.cpp @@ -430,7 +430,7 @@ TDEHTMLPopupGUIClient::TDEHTMLPopupGUIClient( TDEHTMLPart *tdehtml, const TQStri if (hasSelection) { - KAction* copyAction = KStdAction::copy( d->m_tdehtml->browserExtension(), TQT_SLOT( copy() ), actionCollection(), "copy" ); + TDEAction* copyAction = KStdAction::copy( d->m_tdehtml->browserExtension(), TQT_SLOT( copy() ), actionCollection(), "copy" ); copyAction->setText(i18n("&Copy Text")); copyAction->setEnabled(d->m_tdehtml->browserExtension()->isActionEnabled( "copy" )); actionCollection()->insert( tdehtml->actionCollection()->action( "selectAll" ) ); @@ -477,7 +477,7 @@ TDEHTMLPopupGUIClient::TDEHTMLPopupGUIClient( TDEHTMLPart *tdehtml, const TQStri } // using .arg(foo, bar) instead of .arg(foo).arg(bar), as foo can contain %x - new KAction( i18n( "Search for '%1' with %2" ).arg( selectedText, name ), icon, 0, d->m_tdehtml->browserExtension(), + new TDEAction( i18n( "Search for '%1' with %2" ).arg( selectedText, name ), icon, 0, d->m_tdehtml->browserExtension(), TQT_SLOT( searchProvider() ), actionCollection(), "searchProvider" ); // favorite search providers @@ -486,7 +486,7 @@ TDEHTMLPopupGUIClient::TDEHTMLPopupGUIClient( TDEHTMLPart *tdehtml, const TQStri favoriteEngines = config.readListEntry("FavoriteSearchEngines", favoriteEngines); if ( !favoriteEngines.isEmpty()) { - KActionMenu* providerList = new KActionMenu( i18n( "Search for '%1' with" ).arg( selectedText ), actionCollection(), "searchProviderList" ); + TDEActionMenu* providerList = new TDEActionMenu( i18n( "Search for '%1' with" ).arg( selectedText ), actionCollection(), "searchProviderList" ); TQStringList::ConstIterator it = favoriteEngines.begin(); for ( ; it != favoriteEngines.end(); ++it ) { @@ -507,7 +507,7 @@ TDEHTMLPopupGUIClient::TDEHTMLPopupGUIClient( TDEHTMLPart *tdehtml, const TQStri icon = TQPixmap( iconPath ); name = service->name(); - providerList->insert( new KAction( name, icon, 0, d->m_tdehtml->browserExtension(), + providerList->insert( new TDEAction( name, icon, 0, d->m_tdehtml->browserExtension(), TQT_SLOT( searchProvider() ), actionCollection(), TQString( "searchProvider" + searchProviderPrefix ).latin1() ) ); } } @@ -515,14 +515,14 @@ TDEHTMLPopupGUIClient::TDEHTMLPopupGUIClient( TDEHTMLPart *tdehtml, const TQStri if ( selectedText.contains("://") && KURL(selectedText).isValid() ) - new KAction( i18n( "Open '%1'" ).arg( selectedText ), "window_new", 0, + new TDEAction( i18n( "Open '%1'" ).arg( selectedText ), "window_new", 0, d->m_tdehtml->browserExtension(), TQT_SLOT( openSelection() ), actionCollection(), "openSelection" ); } else if ( url.isEmpty() && !isImage ) { actionCollection()->insert( tdehtml->actionCollection()->action( "security" ) ); actionCollection()->insert( tdehtml->actionCollection()->action( "setEncoding" ) ); - new KAction( i18n( "Stop Animations" ), 0, this, TQT_SLOT( slotStopAnimations() ), + new TDEAction( i18n( "Stop Animations" ), 0, this, TQT_SLOT( slotStopAnimations() ), actionCollection(), "stopanimations" ); } @@ -530,14 +530,14 @@ TDEHTMLPopupGUIClient::TDEHTMLPopupGUIClient( TDEHTMLPart *tdehtml, const TQStri { if (url.protocol() == "mailto") { - new KAction( i18n( "Copy Email Address" ), 0, this, TQT_SLOT( slotCopyLinkLocation() ), + new TDEAction( i18n( "Copy Email Address" ), 0, this, TQT_SLOT( slotCopyLinkLocation() ), actionCollection(), "copylinklocation" ); } else { - new KAction( i18n( "&Save Link As..." ), 0, this, TQT_SLOT( slotSaveLinkAs() ), + new TDEAction( i18n( "&Save Link As..." ), 0, this, TQT_SLOT( slotSaveLinkAs() ), actionCollection(), "savelinkas" ); - new KAction( i18n( "Copy &Link Address" ), 0, this, TQT_SLOT( slotCopyLinkLocation() ), + new TDEAction( i18n( "Copy &Link Address" ), 0, this, TQT_SLOT( slotCopyLinkLocation() ), actionCollection(), "copylinklocation" ); } } @@ -547,28 +547,28 @@ TDEHTMLPopupGUIClient::TDEHTMLPopupGUIClient( TDEHTMLPart *tdehtml, const TQStri { if ( tdehtml->parentPart() ) { - new KAction( i18n( "Open in New &Window" ), "window_new", 0, this, TQT_SLOT( slotFrameInWindow() ), + new TDEAction( i18n( "Open in New &Window" ), "window_new", 0, this, TQT_SLOT( slotFrameInWindow() ), actionCollection(), "frameinwindow" ); - new KAction( i18n( "Open in &This Window" ), 0, this, TQT_SLOT( slotFrameInTop() ), + new TDEAction( i18n( "Open in &This Window" ), 0, this, TQT_SLOT( slotFrameInTop() ), actionCollection(), "frameintop" ); - new KAction( i18n( "Open in &New Tab" ), "tab_new", 0, this, TQT_SLOT( slotFrameInTab() ), + new TDEAction( i18n( "Open in &New Tab" ), "tab_new", 0, this, TQT_SLOT( slotFrameInTab() ), actionCollection(), "frameintab" ); - new KAction( i18n( "Reload Frame" ), 0, this, TQT_SLOT( slotReloadFrame() ), + new TDEAction( i18n( "Reload Frame" ), 0, this, TQT_SLOT( slotReloadFrame() ), actionCollection(), "reloadframe" ); if ( TDEHTMLFactory::defaultHTMLSettings()->isAdFilterEnabled() ) { if ( tdehtml->d->m_frame->m_type == tdehtml::ChildFrame::IFrame ) - new KAction( i18n( "Block IFrame..." ), 0, this, TQT_SLOT( slotBlockIFrame() ), actionCollection(), "blockiframe" ); + new TDEAction( i18n( "Block IFrame..." ), 0, this, TQT_SLOT( slotBlockIFrame() ), actionCollection(), "blockiframe" ); } - new KAction( i18n( "View Frame Source" ), 0, d->m_tdehtml, TQT_SLOT( slotViewDocumentSource() ), + new TDEAction( i18n( "View Frame Source" ), 0, d->m_tdehtml, TQT_SLOT( slotViewDocumentSource() ), actionCollection(), "viewFrameSource" ); - new KAction( i18n( "View Frame Information" ), 0, d->m_tdehtml, TQT_SLOT( slotViewPageInfo() ), actionCollection(), "viewFrameInfo" ); + new TDEAction( i18n( "View Frame Information" ), 0, d->m_tdehtml, TQT_SLOT( slotViewPageInfo() ), actionCollection(), "viewFrameInfo" ); // This one isn't in tdehtml_popupmenu.rc anymore, because Print isn't either, // and because print frame is already in the toolbar and the menu. // But leave this here, so that it's easy to read it. - new KAction( i18n( "Print Frame..." ), "frameprint", 0, d->m_tdehtml->browserExtension(), TQT_SLOT( print() ), actionCollection(), "printFrame" ); - new KAction( i18n( "Save &Frame As..." ), 0, d->m_tdehtml, TQT_SLOT( slotSaveFrame() ), actionCollection(), "saveFrame" ); + new TDEAction( i18n( "Print Frame..." ), "frameprint", 0, d->m_tdehtml->browserExtension(), TQT_SLOT( print() ), actionCollection(), "printFrame" ); + new TDEAction( i18n( "Save &Frame As..." ), 0, d->m_tdehtml, TQT_SLOT( slotSaveFrame() ), actionCollection(), "saveFrame" ); actionCollection()->insert( tdehtml->parentPart()->actionCollection()->action( "viewDocumentSource" ) ); actionCollection()->insert( tdehtml->parentPart()->actionCollection()->action( "viewPageInfo" ) ); @@ -579,7 +579,7 @@ TDEHTMLPopupGUIClient::TDEHTMLPopupGUIClient( TDEHTMLPart *tdehtml, const TQStri } else if (isImage || !url.isEmpty()) { actionCollection()->insert( tdehtml->actionCollection()->action( "viewDocumentSource" ) ); actionCollection()->insert( tdehtml->actionCollection()->action( "viewPageInfo" ) ); - new KAction( i18n( "Stop Animations" ), 0, this, TQT_SLOT( slotStopAnimations() ), + new TDEAction( i18n( "Stop Animations" ), 0, this, TQT_SLOT( slotStopAnimations() ), actionCollection(), "stopanimations" ); } @@ -598,35 +598,35 @@ TDEHTMLPopupGUIClient::TDEHTMLPopupGUIClient( TDEHTMLPart *tdehtml, const TQStri } else d->m_imageURL = KURL( static_cast( e ).src().string() ); - new KAction( i18n( "Save Image As..." ), 0, this, TQT_SLOT( slotSaveImageAs() ), + new TDEAction( i18n( "Save Image As..." ), 0, this, TQT_SLOT( slotSaveImageAs() ), actionCollection(), "saveimageas" ); - new KAction( i18n( "Send Image..." ), 0, this, TQT_SLOT( slotSendImage() ), + new TDEAction( i18n( "Send Image..." ), 0, this, TQT_SLOT( slotSendImage() ), actionCollection(), "sendimage" ); #ifndef QT_NO_MIMECLIPBOARD - (new KAction( i18n( "Copy Image" ), 0, this, TQT_SLOT( slotCopyImage() ), + (new TDEAction( i18n( "Copy Image" ), 0, this, TQT_SLOT( slotCopyImage() ), actionCollection(), "copyimage" ))->setEnabled(!d->m_pixmap.isNull()); #endif if(d->m_pixmap.isNull()) { //fallback to image location if still loading the image. this will always be true if ifdef QT_NO_MIMECLIPBOARD - new KAction( i18n( "Copy Image Location" ), 0, this, TQT_SLOT( slotCopyImageLocation() ), + new TDEAction( i18n( "Copy Image Location" ), 0, this, TQT_SLOT( slotCopyImageLocation() ), actionCollection(), "copyimagelocation" ); } TQString name = KStringHandler::csqueeze(d->m_imageURL.fileName()+d->m_imageURL.query(), 25); - new KAction( i18n( "View Image (%1)" ).arg(d->m_suggestedFilename.isEmpty() ? name.replace("&", "&&") : d->m_suggestedFilename.replace("&", "&&")), 0, this, TQT_SLOT( slotViewImage() ), + new TDEAction( i18n( "View Image (%1)" ).arg(d->m_suggestedFilename.isEmpty() ? name.replace("&", "&&") : d->m_suggestedFilename.replace("&", "&&")), 0, this, TQT_SLOT( slotViewImage() ), actionCollection(), "viewimage" ); if (TDEHTMLFactory::defaultHTMLSettings()->isAdFilterEnabled()) { - new KAction( i18n( "Block Image..." ), 0, this, TQT_SLOT( slotBlockImage() ), + new TDEAction( i18n( "Block Image..." ), 0, this, TQT_SLOT( slotBlockImage() ), actionCollection(), "blockimage" ); if (!d->m_imageURL.host().isEmpty() && !d->m_imageURL.protocol().isEmpty()) { - new KAction( i18n( "Block Images From %1" ).arg(d->m_imageURL.host()), 0, this, TQT_SLOT( slotBlockHost() ), + new TDEAction( i18n( "Block Images From %1" ).arg(d->m_imageURL.host()), 0, this, TQT_SLOT( slotBlockHost() ), actionCollection(), "blockhost" ); } } @@ -962,13 +962,13 @@ extern const int KDE_NO_EXPORT fastZoomSizeCount; // BCI: remove in KDE 4 TDEHTMLZoomFactorAction::TDEHTMLZoomFactorAction( TDEHTMLPart *part, bool direction, const TQString &text, const TQString &icon, const TQObject *receiver, const char *slot, TQObject *parent, const char *name ) - : KAction( text, icon, 0, receiver, slot, parent, name ) + : TDEAction( text, icon, 0, receiver, slot, parent, name ) { init(part, direction); } -TDEHTMLZoomFactorAction::TDEHTMLZoomFactorAction( TDEHTMLPart *part, bool direction, const TQString &text, const TQString &icon, const KShortcut &cut, const TQObject *receiver, const char *slot, TQObject *parent, const char *name ) - : KAction( text, icon, cut, receiver, slot, parent, name ) +TDEHTMLZoomFactorAction::TDEHTMLZoomFactorAction( TDEHTMLPart *part, bool direction, const TQString &text, const TQString &icon, const TDEShortcut &cut, const TQObject *receiver, const char *slot, TQObject *parent, const char *name ) + : TDEAction( text, icon, cut, receiver, slot, parent, name ) { init(part, direction); } @@ -1006,11 +1006,11 @@ TDEHTMLZoomFactorAction::~TDEHTMLZoomFactorAction() int TDEHTMLZoomFactorAction::plug( TQWidget *w, int index ) { - int containerId = KAction::plug( w, index ); - if ( containerId == -1 || !w->inherits( "KToolBar" ) ) + int containerId = TDEAction::plug( w, index ); + if ( containerId == -1 || !w->inherits( "TDEToolBar" ) ) return containerId; - KToolBarButton *button = static_cast( w )->getButton( itemId( containerId ) ); + TDEToolBarButton *button = static_cast( w )->getButton( itemId( containerId ) ); if ( !button ) return containerId; -- cgit v1.2.1 From d1e0cc99a202cef3306b90b8839a6726e89f201e Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Fri, 1 Feb 2013 23:21:04 -0600 Subject: Rename many classes and header files to avoid conflicts with KDE4 --- tdehtml/tdehtml_ext.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tdehtml/tdehtml_ext.cpp') diff --git a/tdehtml/tdehtml_ext.cpp b/tdehtml/tdehtml_ext.cpp index 72576e91e..fe9763b0e 100644 --- a/tdehtml/tdehtml_ext.cpp +++ b/tdehtml/tdehtml_ext.cpp @@ -48,8 +48,8 @@ #include #include #include -#include -#include +#include +#include #include #include #include -- cgit v1.2.1 From 8bd62a3b0d3b362b783a273e2460811392485bbd Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Thu, 14 Feb 2013 17:17:18 -0600 Subject: Rename common header files for consistency with class renaming --- tdehtml/tdehtml_ext.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tdehtml/tdehtml_ext.cpp') diff --git a/tdehtml/tdehtml_ext.cpp b/tdehtml/tdehtml_ext.cpp index fe9763b0e..3cc65676d 100644 --- a/tdehtml/tdehtml_ext.cpp +++ b/tdehtml/tdehtml_ext.cpp @@ -53,7 +53,7 @@ #include #include #include -#include +#include #include #include #include -- cgit v1.2.1 From ed99a30644c19b0a3cf0d2147243532df4daa16b Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Fri, 15 Feb 2013 21:57:54 -0600 Subject: Rename additional header files to avoid conflicts with KDE4 --- tdehtml/tdehtml_ext.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tdehtml/tdehtml_ext.cpp') diff --git a/tdehtml/tdehtml_ext.cpp b/tdehtml/tdehtml_ext.cpp index 3cc65676d..b7dfb8a42 100644 --- a/tdehtml/tdehtml_ext.cpp +++ b/tdehtml/tdehtml_ext.cpp @@ -44,7 +44,7 @@ #include #include -#include +#include #include #include #include @@ -54,7 +54,7 @@ #include #include #include -#include +#include #include #include #include -- cgit v1.2.1