Commit 47b3a0a7 authored by Aaron J. Seigo's avatar Aaron J. Seigo
Browse files

snapshot porting

svn path=/trunk/KDE/kdebase/konqueror/; revision=538633
parent 16157c36
......@@ -5,14 +5,15 @@
#include <QTextStream>
#include <kaboutdata.h>
#include <kaction.h>
#include <kactioncollection.h>
#include <kapplication.h>
#include <kdebug.h>
#include <kiconloader.h>
#include <klocale.h>
#include <kmessagebox.h>
#include <ksavefile.h>
#include <kstandarddirs.h>
#include <kaction.h>
#include <kiconloader.h>
#include <ktoolinvocation.h>
#include <assert.h>
......@@ -50,15 +51,13 @@ KonqAboutPageFactory::~KonqAboutPageFactory()
s_plugins_html = 0;
}
KParts::Part *KonqAboutPageFactory::createPartObject( QWidget *parentWidget, const char *widgetName,
QObject *parent, const char *name,
KParts::Part *KonqAboutPageFactory::createPartObject( QWidget *parentWidget, QObject *parent,
const char *, const QStringList & )
{
//KonqFrame *frame = dynamic_cast<KonqFrame *>( parentWidget );
//if ( !frame ) return 0;
return new KonqAboutPage( //frame->childView()->mainWindow(),
parentWidget, widgetName, parent, name );
return new KonqAboutPage( parentWidget, parent );
}
QString KonqAboutPageFactory::loadFile( const QString& file )
......@@ -403,9 +402,8 @@ QString KonqAboutPageFactory::plugins()
KonqAboutPage::KonqAboutPage( //KonqMainWindow *
QWidget *parentWidget, const char *widgetName,
QObject *parent, const char *name )
: KHTMLPart( parentWidget, widgetName, parent, name, BrowserViewGUI )
QWidget *parentWidget, QObject *parent )
: KHTMLPart( parentWidget, parent, BrowserViewGUI )
{
//m_mainWindow = mainWindow;
QTextCodec* codec = KGlobal::locale()->codecForEncoding();
......
......@@ -13,8 +13,7 @@ public:
KonqAboutPageFactory( QObject *parent = 0 );
virtual ~KonqAboutPageFactory();
virtual KParts::Part *createPartObject( QWidget *parentWidget, const char *widgetName,
QObject *parent, const char *name,
virtual KParts::Part *createPartObject( QWidget *parentWidget, QObject *parent,
const char *classname, const QStringList &args );
static KInstance *instance() { return s_instance; }
......@@ -36,9 +35,7 @@ class KonqAboutPage : public KHTMLPart
{
Q_OBJECT
public:
KonqAboutPage( /*KonqMainWindow *mainWindow,*/
QWidget *parentWidget, const char *widgetName,
QObject *parent, const char *name );
KonqAboutPage( QWidget *parentWidget, QObject *parent );
~KonqAboutPage();
virtual bool openURL( const KUrl &url );
......
......@@ -34,7 +34,7 @@
K_EXPORT_COMPONENT_FACTORY( konq_part, KonqFactory )
KonqPart::KonqPart( QWidget* parentWidget, const char*, QObject* parent, const char* name, const QStringList& args )
KonqPart::KonqPart( QWidget* parentWidget, QObject* parent, const QStringList& args )
: KonqDirPart( parent )
,m_dirLister( new KDirLister() )
,m_model( new KonqModel( parent ) )
......
......@@ -35,7 +35,7 @@ class KonqPart : public KonqDirPart
{
Q_OBJECT
public:
KonqPart( QWidget* parentWidget, const char*, QObject* parent, const char*, const QStringList& );
KonqPart( QWidget* parentWidget, QObject* parent, const QStringList& );
virtual ~KonqPart();
static KAboutData* createAboutData();
private:
......
......@@ -27,21 +27,24 @@
#include <unistd.h>
#include <qfile.h>
#include <kaction.h>
#include <kactioncollection.h>
#include <kactionmenu.h>
#include <kapplication.h>
#include <kdebug.h>
#include <kdirlister.h>
#include <kglobalsettings.h>
#include <kinputdialog.h>
#include <kivdirectoryoverlay.h>
#include <klocale.h>
#include <kmessagebox.h>
#include <konq_settings.h>
#include <kpropertiesdialog.h>
#include <kseparatoraction.h>
#include <kstaticdeleter.h>
#include <kstdaction.h>
#include <kparts/factory.h>
#include <ktrader.h>
#include <klocale.h>
#include <kivdirectoryoverlay.h>
#include <kmessagebox.h>
#include <kstaticdeleter.h>
#include <ktoggleaction.h>
#include <qregexp.h>
#include <qdatetime.h>
......@@ -69,14 +72,13 @@ public:
s_defaultViewProps = 0;
}
virtual KParts::Part* createPartObject( QWidget *parentWidget, const char *,
QObject *parent, const char *name, const char*, const QStringList &args )
virtual KParts::Part* createPartObject( QWidget *parentWidget,
QObject *parent, const char*, const QStringList &args )
{
if( args.count() < 1 )
kWarning() << "KonqKfmIconView: Missing Parameter" << endl;
KonqKfmIconView *obj = new KonqKfmIconView( parentWidget, parent, args.first() );
obj->setObjectName( name );
return obj;
}
......@@ -787,7 +789,7 @@ void KonqKfmIconView::slotContextMenuRequested(Q3IconViewItem* _item, const QPoi
KFileItemList::const_iterator kit = items.begin();
const KFileItemList::const_iterator kend = items.end();
for ( ; kit != kend; ++kit )
if ( (*kit)->url().directory( 1 ) != rootItem->url().path() )
if ( (*kit)->url().directory( ) != rootItem->url().path() )
parentDirURL = KUrl();
// If rootItem is the parent of the selected items, then we can use isWritable() on it.
if ( !parentDirURL.isEmpty() && !rootItem->isWritable() )
......@@ -862,7 +864,7 @@ void KonqKfmIconView::slotCanceled( const KUrl& url )
{
// Check if this canceled() signal is about the URL we're listing.
// It could be about the URL we were listing, and openURL() aborted it.
if ( m_bLoading && url.equals( m_pIconView->url(), true ) )
if ( m_bLoading && url.equals( m_pIconView->url(), KUrl::CompareWithoutTrailingSlash ) )
{
emit canceled( QString() );
m_bLoading = false;
......
......@@ -21,7 +21,7 @@
#define __konq_actions_h__
#include <konq_historymgr.h>
#include <kaction.h>
#include <kactionmenu.h>
#include <qlist.h>
class HistoryEntry;
......
......@@ -46,8 +46,7 @@ KonqViewFactory::KonqViewFactory( KLibFactory *factory, const QStringList &args,
m_args << QLatin1String( "Browser/View" );
}
KParts::ReadOnlyPart *KonqViewFactory::create( QWidget *parentWidget, const char *widgetName,
QObject * parent, const char *name )
KParts::ReadOnlyPart *KonqViewFactory::create( QWidget *parentWidget, QObject * parent )
{
if ( !m_factory )
return 0L;
......@@ -57,18 +56,18 @@ KParts::ReadOnlyPart *KonqViewFactory::create( QWidget *parentWidget, const char
if ( m_factory->inherits( "KParts::Factory" ) )
{
if ( m_createBrowser )
obj = static_cast<KParts::Factory *>(m_factory)->createPart( parentWidget, widgetName, parent, name, "Browser/View", m_args );
obj = static_cast<KParts::Factory *>(m_factory)->createPart( parentWidget, parent, "Browser/View", m_args );
if ( !obj )
obj = static_cast<KParts::Factory *>(m_factory)->createPart( parentWidget, widgetName, parent, name, "KParts::ReadOnlyPart", m_args );
obj = static_cast<KParts::Factory *>(m_factory)->createPart( parentWidget, parent, "KParts::ReadOnlyPart", m_args );
}
else
{
if ( m_createBrowser )
obj = m_factory->create( parentWidget, name, "Browser/View", m_args );
obj = m_factory->create( parentWidget, "Browser/View", m_args );
if ( !obj )
obj = m_factory->create( parentWidget, name, "KParts::ReadOnlyPart", m_args );
obj = m_factory->create( parentWidget, "KParts::ReadOnlyPart", m_args );
}
if ( !obj->inherits( "KParts::ReadOnlyPart" ) )
......
......@@ -52,8 +52,7 @@ public:
return *this;
}
KParts::ReadOnlyPart *create( QWidget *parentWidget, const char *widgetName,
QObject *parent, const char *name );
KParts::ReadOnlyPart *create( QWidget *parentWidget, QObject *parent );
bool isNull() const { return m_factory ? false : true; }
......
......@@ -36,6 +36,7 @@
#include <QVBoxLayout>
#include <QMouseEvent>
#include <kactioncollection.h>
#include <kapplication.h>
#include <kdebug.h>
#include <kglobalsettings.h>
......@@ -366,7 +367,7 @@ KParts::ReadOnlyPart *KonqFrame::attach( const KonqViewFactory &viewFactory )
// We don't want that deleting the widget deletes the part automatically
// because we already have that taken care of in KParts...
m_pPart = factory.create( this, "view widget", 0, "" );
m_pPart = factory.create( this, 0 );
assert( m_pPart->widget() );
......
......@@ -77,6 +77,8 @@
#include <QCloseEvent>
#include <QPixmap>
#include <k3widgetaction.h>
#include <dcopclient.h>
#include <kaboutdata.h>
#include <kbookmarkbar.h>
......@@ -96,11 +98,13 @@
#include "konq_main.h"
#include <konq_undo.h>
#include <kprotocolinfo.h>
#include <kseparatoraction.h>
#include <kstdaccel.h>
#include <kstdaction.h>
#include <kstandarddirs.h>
#include <ksycoca.h>
#include <ktempfile.h>
#include <ktoolbarpopupaction.h>
#include <kurlrequesterdlg.h>
#include <kurlrequester.h>
#include <kuserprofile.h>
......@@ -455,7 +459,7 @@ void KonqMainWindow::openFilteredUrl( const QString & url, KonqOpenURLRequest &
{
// Filter URL to build a correct one
if (m_currentDir.isEmpty() && m_currentView)
m_currentDir = m_currentView->url().path(1);
m_currentDir = m_currentView->url().path( KUrl::AddTrailingSlash );
KUrl filteredURL ( KonqMisc::konqFilteredURL( this, url, m_currentDir ) );
kDebug(1202) << "url " << url << " filtered into " << filteredURL.prettyURL() << endl;
......@@ -969,7 +973,8 @@ void KonqMainWindow::openURL( KonqView *childView, const KUrl &url, const KParts
// Clicking on a link that points to the page itself (e.g. anchor)
if ( !args.doPost() && !args.reload &&
childView && urlcmp( url.url(), childView->url().url(), true, true ) )
childView && urlcmp( url.url(), childView->url().url(),
KUrl::CompareWithoutTrailingSlash | KUrl::CompareWithoutFragment ) )
{
QString serviceType = args.serviceType;
if ( serviceType.isEmpty() )
......@@ -1425,7 +1430,7 @@ void KonqMainWindow::slotOpenLocation()
// Testcase: konqueror www.kde.org; Ctrl+O; file in $HOME; would open http://$file
QString currentDir;
if (m_currentView && m_currentView->url().isLocalFile())
currentDir = m_currentView->url().path(1);
currentDir = m_currentView->url().path( KUrl::AddTrailingSlash );
dlg.urlRequester()->completionObject()->setDir( currentDir );
dlg.urlRequester()->setMode( KFile::File | KFile::Directory | KFile::ExistingOnly );
dlg.exec();
......@@ -1456,7 +1461,7 @@ void KonqMainWindow::slotToolFind()
return;
}
KParts::ReadOnlyPart* findPart = factory.create( m_currentView->frame(), "findPartWidget", dirPart, "findPart" );
KParts::ReadOnlyPart* findPart = factory.create( m_currentView->frame(), dirPart );
dirPart->setFindPart( findPart );
m_currentView->frame()->insertTopWidget( findPart->widget() );
......@@ -3872,10 +3877,10 @@ void KonqMainWindow::initActions()
// Location bar
m_locationLabel = new KonqDraggableLabel( this, i18n("L&ocation: ") );
(void) new KWidgetAction( m_locationLabel, i18n("L&ocation: "), Qt::Key_F6, this, SLOT( slotLocationLabelActivated() ), actionCollection(), "location_label" );
(void) new K3WidgetAction( m_locationLabel, i18n("L&ocation: "), Qt::Key_F6, this, SLOT( slotLocationLabelActivated() ), actionCollection(), "location_label" );
m_locationLabel->setBuddy( m_combo );
KWidgetAction* comboAction = new KWidgetAction( m_combo, i18n( "Location Bar" ), 0,
K3WidgetAction* comboAction = new K3WidgetAction( m_combo, i18n( "Location Bar" ), 0,
0, 0, actionCollection(), "toolbar_url_combo" );
comboAction->setShortcutConfigurable( false );
......@@ -4651,7 +4656,7 @@ void KonqMainWindow::slotPopupMenu( KXMLGUIClient *client, const QPoint &_global
if ( !viewURL.isEmpty() )
{
//firstURL.cleanPath();
openedForViewURL = firstURL.equals( viewURL, true );
openedForViewURL = firstURL.equals( viewURL, KUrl::CompareWithoutTrailingSlash );
}
devicesFile = firstURL.protocol().indexOf("device", 0, Qt::CaseInsensitive) == 0;
//dirsSelected = S_ISDIR( _items.first()->mode() );
......
......@@ -51,6 +51,7 @@
#include "konq_combo.h"
#include "konq_frame.h"
#include <klocalizedstring.h>
#include <ktogglefullscreenaction.h>
class QFile;
class KAction;
......
......@@ -29,6 +29,7 @@
#include <qfileinfo.h>
#include <kaccelgen.h>
#include <kactionmenu.h>
#include <kstandarddirs.h>
#include <kdebug.h>
#include <kapplication.h>
......
......@@ -34,10 +34,9 @@
#include <ktrader.h>
#include <ktoolinvocation.h>
KHTMLPluginKTTSD::KHTMLPluginKTTSD( QObject* parent, const char* name, const QStringList& )
KHTMLPluginKTTSD::KHTMLPluginKTTSD( QObject* parent, const QStringList& )
: Plugin( parent )
{
setObjectName(name);
// If KTTSD is not installed, hide action.
KTrader::OfferList offers = KTrader::self()->query("DCOP/Text-to-Speech", "Name == 'KTTSD'");
if (offers.count() > 0)
......
......@@ -33,7 +33,7 @@ public:
/**
* Construct a new KParts plugin.
*/
KHTMLPluginKTTSD( QObject* parent, const char* name, const QStringList& );
KHTMLPluginKTTSD( QObject* parent, const QStringList& );
/**
* Destructor.
......
......@@ -26,6 +26,7 @@
#include <kdebug.h>
#include <kaction.h>
#include <kservicetype.h>
#include <kselectaction.h>
#include <kuserprofile.h>
#include <kio/metainfojob.h>
......
......@@ -30,12 +30,13 @@
#include <kdebug.h>
#include <kdirlister.h>
#include <kinputdialog.h>
#include <klineedit.h>
#include <klocale.h>
#include <kmimetype.h>
#include <kpropertiesdialog.h>
#include <kstdaction.h>
#include <ktoggleaction.h>
#include <kprotocolinfo.h>
#include <klineedit.h>
#include <kmimetype.h>
#include <qapplication.h>
#include <qclipboard.h>
......@@ -64,13 +65,12 @@ KonqListViewFactory::~KonqListViewFactory()
s_defaultViewProps = 0;
}
KParts::Part* KonqListViewFactory::createPartObject( QWidget *parentWidget, const char *, QObject *parent, const char *name, const char*, const QStringList &args )
KParts::Part* KonqListViewFactory::createPartObject( QWidget *parentWidget, QObject *parent, const char*, const QStringList &args )
{
if( args.count() < 1 )
kWarning() << "KonqListView: Missing Parameter" << endl;
KParts::Part *obj = new KonqListView( parentWidget, parent, args.first() );
obj->setObjectName( name );
return obj;
}
......
......@@ -44,7 +44,7 @@ public:
KonqListViewFactory();
virtual ~KonqListViewFactory();
virtual KParts::Part* createPartObject( QWidget *parentWidget, const char *, QObject *parent, const char *name, const char*, const QStringList &args );
virtual KParts::Part* createPartObject( QWidget *parentWidget, QObject *parent, const char*, const QStringList &args );
static KInstance *instance();
static KonqPropsView *defaultViewProps();
......
......@@ -26,11 +26,11 @@
#include <kdebug.h>
#include <kdirlister.h>
#include <kiconloader.h>
#include <klocale.h>
#include <kprotocolinfo.h>
#include <kaction.h>
#include <kmessagebox.h>
#include <kiconloader.h>
#include <ktoggleaction.h>
#include <q3header.h>
#include <qpainter.h>
......@@ -983,8 +983,8 @@ bool KonqBaseListViewWidget::openURL( const KUrl &url )
m_bTopLevelComplete = false;
m_itemFound = false;
if ( m_itemToGoTo.isEmpty() && url.equals( m_url.upURL(), true ) )
m_itemToGoTo = m_url.fileName( true );
if ( m_itemToGoTo.isEmpty() && url.equals( m_url.upURL(), KUrl::CompareWithoutTrailingSlash ) )
m_itemToGoTo = m_url.fileName( KUrl::IgnoreTrailingSlash );
// Check for new properties in the new dir
// newProps returns true the first time, and any time something might
......@@ -1344,7 +1344,7 @@ void KonqBaseListViewWidget::saveState( QDataStream & ds )
{
QString str;
if ( currentItem() )
str = static_cast<KonqBaseListViewItem*>(currentItem())->item()->url().fileName(true);
str = static_cast<KonqBaseListViewItem*>(currentItem())->item()->url().fileName( KUrl::IgnoreTrailingSlash );
ds << str << m_url;
}
......
......@@ -88,8 +88,8 @@ void KonqListViewDir::open( bool _open, bool _reload )
}
}
QString KonqListViewDir::url( int _trailing )
QString KonqListViewDir::url( KUrl::AdjustPathOption trailing )
{
return item()->url().url( _trailing );
return item()->url().url( trailing );
}
......@@ -70,7 +70,7 @@ public:
* URL of this directory
* @param _trailing set to true for a trailing slash (see KUrl)
*/
QString url( int _trailing );
QString url( KUrl::AdjustPathOption _trailing );
protected:
bool m_bComplete;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment