Commit 6b229474 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

KURL--

svn path=/trunk/KDE/kdebase/konqueror/; revision=508560
parent 27f45d95
......@@ -141,7 +141,7 @@ void ChFaceDlg::addCustomPixmap( QString imPath, bool saveCopy )
userfaces.mkdir( userfaces.absolutePath() );
pix.save( userfaces.absolutePath() + "/.userinfo-tmp" , "PNG" );
KonqOperations::copy( this, KonqOperations::COPY, KUrl::List( KURL( userfaces.absolutePath() + "/.userinfo-tmp" ) ), KURL( userfaces.absPath() + "/" + QFileInfo(imPath).fileName().section(".",0,0) ) );
KonqOperations::copy( this, KonqOperations::COPY, KUrl::List( KUrl( userfaces.absolutePath() + "/.userinfo-tmp" ) ), KUrl( userfaces.absPath() + "/" + QFileInfo(imPath).fileName().section(".",0,0) ) );
#if 0
if ( !pix.save( userfaces.absolutePath() + "/" + imPath , "PNG" ) )
KMessageBox::sorry(this, i18n("There was an error saving the image:\n%1").arg( userfaces.absolutePath() ) );
......
......@@ -326,7 +326,7 @@ inline KUrl *KCMUserAccount::decodeImgDrop(QDropEvent *e, QWidget *wdg)
if (K3URLDrag::decode(e, uris) && (uris.count() > 0))
{
KUrl *url = new KURL(uris.first());
KUrl *url = new KUrl(uris.first());
KMimeType::Ptr mime = KMimeType::findByURL( *url );
if ( mime && KImageIO::isSupported( mime->name(), KImageIO::Reading ) )
......
......@@ -370,7 +370,7 @@ void ActionsImpl::slotNewBookmark()
// TODO - make a setCurrentItem(Command *) which uses finaladdress interface
CreateCommand * cmd = new CreateCommand(
KEBApp::self()->insertAddress(),
QString(), "www", KURL("http://"));
QString(), "www", KUrl("http://"));
CmdHistory::self()->addCommand(cmd);
}
......@@ -425,7 +425,7 @@ void ActionsImpl::slotPrint() {
s_part->setProperty("javaScriptEnabled", QVariant(false, 1));
s_part->setProperty("javaEnabled", QVariant(false, 1));
// doc->openStream( "text/html", KURL() );
// doc->openStream( "text/html", KUrl() );
// doc->writeStream( QCString( "<HTML><BODY>FOO</BODY></HTML>" ) );
// doc->closeStream();
......@@ -440,7 +440,7 @@ void ActionsImpl::slotPrint() {
s_objId = s_part->property("dcopObjectId").toString().toLatin1();
connect(s_part, SIGNAL(completed()), this, SLOT(slotDelayedPrint()));
s_part->openURL(KURL( tmpf.name() ));
s_part->openURL(KUrl( tmpf.name() ));
}
void ActionsImpl::slotDelayedPrint() {
......
......@@ -197,7 +197,7 @@ void KFindPart::restoreState( QDataStream& stream )
slotStarted();
for(int i=0;i<nbitems;i++)
{
KFileItem* item = new KFileItem( KFileItem::Unknown, KFileItem::Unknown, KURL() );
KFileItem* item = new KFileItem( KFileItem::Unknown, KFileItem::Unknown, KUrl() );
stream >> *item;
m_lstFileItems.append(item);
}
......
......@@ -578,7 +578,7 @@ void KfindTabWidget::setQuery(KQuery *query)
// only start if we have valid dates
if (!isDateValid()) return;
query->setPath(KURL(dirBox->currentText().trimmed()));
query->setPath(KUrl(dirBox->currentText().trimmed()));
for (int idx=0; idx<dirBox->count(); idx++)
if (dirBox->text(idx)==dirBox->currentText())
......@@ -753,7 +753,7 @@ void KfindTabWidget::getDirectory()
void KfindTabWidget::beginSearch()
{
/// dirlister->openURL(KURL(dirBox->currentText().trimmed()));
/// dirlister->openURL(KUrl(dirBox->currentText().trimmed()));
saveHistory();
setEnabled( false );
......
......@@ -162,7 +162,7 @@ void KQuery::slotListEntries( QStringList list )
for (; it != end; ++it)
{
file = new KFileItem( KFileItem::Unknown, KFileItem::Unknown, KURL(*it));
file = new KFileItem( KFileItem::Unknown, KFileItem::Unknown, KUrl(*it));
processQuery(file);
delete file;
}
......
......@@ -55,7 +55,7 @@ KonquerorIface::~KonquerorIface()
DCOPRef KonquerorIface::openBrowserWindow( const QString &url )
{
QX11Info::setAppUserTime( 0 );
KonqMainWindow *res = KonqMisc::createSimpleWindow( KURL(url) );
KonqMainWindow *res = KonqMisc::createSimpleWindow( KUrl(url) );
if ( !res )
return DCOPRef();
return res->dcopObject();
......@@ -81,7 +81,7 @@ DCOPRef KonquerorIface::createNewWindowASN( const QString &url, const DCOPCStrin
DCOPRef KonquerorIface::createNewWindowWithSelection( const QString &url, QStringList filesToSelect )
{
QX11Info::setAppUserTime( 0 );
KonqMainWindow *res = KonqMisc::createNewWindow( KURL(url), KParts::URLArgs(), false, filesToSelect );
KonqMainWindow *res = KonqMisc::createNewWindow( KUrl(url), KParts::URLArgs(), false, filesToSelect );
if ( !res )
return DCOPRef();
return res->dcopObject();
......@@ -151,7 +151,7 @@ DCOPRef KonquerorIface::createBrowserWindowFromProfileASN( const QString &path,
DCOPRef KonquerorIface::createBrowserWindowFromProfileAndURL( const QString & path, const QString &filename, const QString &url )
{
QX11Info::setAppUserTime( 0 );
KonqMainWindow *res = KonqMisc::createBrowserWindowFromProfile( path, filename, KURL(url) );
KonqMainWindow *res = KonqMisc::createBrowserWindowFromProfile( path, filename, KUrl(url) );
if ( !res )
return DCOPRef();
return res->dcopObject();
......@@ -169,7 +169,7 @@ DCOPRef KonquerorIface::createBrowserWindowFromProfileAndURL( const QString &pat
QX11Info::setAppUserTime( 0 );
KParts::URLArgs args;
args.serviceType = mimetype;
KonqMainWindow *res = KonqMisc::createBrowserWindowFromProfile( path, filename, KURL(url), args );
KonqMainWindow *res = KonqMisc::createBrowserWindowFromProfile( path, filename, KUrl(url), args );
if ( !res )
return DCOPRef();
return res->dcopObject();
......
......@@ -452,7 +452,7 @@ void KonqAboutPage::restoreState( QDataStream &stream )
void KonqAboutPage::serve( const QString& html, const QString& what )
{
m_what = what;
begin( KURL( QString("about:%1").arg(what) ) );
begin( KUrl( QString("about:%1").arg(what) ) );
write( html );
end();
m_htmlDoc = html;
......
......@@ -233,7 +233,7 @@ static bool startNewKonqueror( QString url, QString mimetype, const QString& pro
mimetype = QLatin1String( "" );
}
if( mimetype.isEmpty())
mimetype = KMimeType::findByURL( KURL( url ) )->name();
mimetype = KMimeType::findByURL( KUrl( url ) )->name();
KTrader::OfferList offers = KTrader::self()->query( mimetype, QLatin1String( "KParts/ReadOnlyPart" ),
QString(), QString() );
KService::Ptr serv;
......
......@@ -782,7 +782,7 @@ void KonqKfmIconView::slotContextMenuRequested(Q3IconViewItem* _item, const QPoi
const KFileItemList::const_iterator kend = items.end();
for ( ; kit != kend; ++kit )
if ( (*kit)->url().directory( 1 ) != rootItem->url().path() )
parentDirURL = KURL();
parentDirURL = KUrl();
// If rootItem is the parent of the selected items, then we can use isWritable() on it.
if ( !parentDirURL.isEmpty() && !rootItem->isWritable() )
popupFlags |= KParts::BrowserExtension::NoDeletion;
......@@ -1513,7 +1513,7 @@ void SpringLoadingManager::finished()
kDebug() << "SpringLoadManager::finished()" << endl;
KUrl url = m_startURL;
m_startURL = KURL();
m_startURL = KUrl();
KParts::ReadOnlyPart *part = m_startPart;
m_startPart = 0L;
......
......@@ -76,7 +76,7 @@ extern "C" KDE_EXPORT int kdemain( int argc, char **argv )
{
QString className = KMainWindow::classNameOfToplevel( n );
if( className == QLatin1String( "KonqMainWindow" ))
(new KonqMainWindow( KURL(), false ) )->restore( n );
(new KonqMainWindow( KUrl(), false ) )->restore( n );
else
kWarning() << "Unknown class " << className << " in session saved data!" << endl;
n++;
......@@ -135,7 +135,7 @@ extern "C" KDE_EXPORT int kdemain( int argc, char **argv )
if( !ref.callExt( "registerPreloadedKonqy", DCOPRef::NoEventLoop, 5000,
app.dcopClient()->appId(), info.screen()))
return 0; // too many preloaded or failed
KonqMainWindow* win = new KonqMainWindow( KURL(), false ); // prepare an empty window too
KonqMainWindow* win = new KonqMainWindow( KUrl(), false ); // prepare an empty window too
// KonqMainWindow ctor sets always the preloaded flag to false, so create the window before this
KonqMainWindow::setPreloadedFlag( true );
KonqMainWindow::setPreloadedWindow( win );
......@@ -174,7 +174,7 @@ extern "C" KDE_EXPORT int kdemain( int argc, char **argv )
if (url.isLocalFile() && QFile::exists(url.path())) // "konqueror index.html"
urlToOpen = url;
else
urlToOpen = KURL( KonqMisc::konqFilteredURL(0L, QString::fromLocal8Bit(args->arg(i))) ); // "konqueror slashdot.org"
urlToOpen = KUrl( KonqMisc::konqFilteredURL(0L, QString::fromLocal8Bit(args->arg(i))) ); // "konqueror slashdot.org"
if ( !mainwin ) {
KParts::URLArgs urlargs;
......
......@@ -652,7 +652,7 @@ void KonqMainWindow::openURL( KonqView *_view, const KUrl &_url,
bool KonqMainWindow::openView( QString serviceType, const KUrl &_url, KonqView *childView, KonqOpenURLRequest& req )
{
// Second argument is referring URL
if ( !KAuthorized::authorizeURLAction("open", childView ? childView->url() : KURL(), _url) )
if ( !KAuthorized::authorizeURLAction("open", childView ? childView->url() : KUrl(), _url) )
{
QString msg = KIO::buildErrorString(KIO::ERR_ACCESS_DENIED, _url.prettyURL());
KMessageBox::queuedMessageBox( this, KMessageBox::Error, msg );
......@@ -779,7 +779,7 @@ bool KonqMainWindow::openView( QString serviceType, const KUrl &_url, KonqView *
( ( indexFile = findIndexFile( url.path() ) ) != QString() ) )
{
serviceType = "text/html";
url = KURL();
url = KUrl();
url.setPath( indexFile );
serviceName.clear(); // cancel what we just set, this is not a dir finally
}
......@@ -1137,14 +1137,14 @@ void KonqMainWindow::slotCreateNewWindow( const KUrl &url, const KParts::URLArgs
if (newtabsinfront)
m_pViewManager->showTab( newView );
openURL( newView, url.isEmpty() ? KURL("about:blank") : url, QString());
openURL( newView, url.isEmpty() ? KUrl("about:blank") : url, QString());
newView->setViewName( args.frameName );
part=newView->part();
return;
}
mainWindow = new KonqMainWindow( KURL(), false );
mainWindow = new KonqMainWindow( KUrl(), false );
mainWindow->setInitialFrameName( args.frameName );
mainWindow->resetAutoSaveSettings(); // Don't autosave
......@@ -1294,7 +1294,7 @@ void KonqMainWindow::slotDuplicateWindow()
config.setGroup( "View Profile" );
m_pViewManager->saveViewProfile( config, true, true );
KonqMainWindow *mainWindow = new KonqMainWindow( KURL(), false, 0, xmlFile());
KonqMainWindow *mainWindow = new KonqMainWindow( KUrl(), false, 0, xmlFile());
mainWindow->viewManager()->loadViewProfile( config, m_pViewManager->currentProfile() );
if (mainWindow->currentView())
{
......@@ -1661,7 +1661,7 @@ void KonqMainWindow::showHTML( KonqView * _view, bool b, bool _activateView )
// This has to be done before calling openView since it relies on it
if ( m_bSaveViewPropertiesLocally )
{
KUrl u ( b ? _view->url() : KURL( _view->url().directory() ) );
KUrl u ( b ? _view->url() : KUrl( _view->url().directory() ) );
u.addPath(".directory");
if ( u.isLocalFile() )
{
......@@ -1822,27 +1822,27 @@ void KonqMainWindow::slotHome()
void KonqMainWindow::slotGoSystem()
{
openURL( 0L, KURL( "system:/" ) );
openURL( 0L, KUrl( "system:/" ) );
}
void KonqMainWindow::slotGoApplications()
{
openURL( 0L, KURL( "programs:/" ) );
openURL( 0L, KUrl( "programs:/" ) );
}
void KonqMainWindow::slotGoMedia()
{
openURL( 0L, KURL( "media:/" ) );
openURL( 0L, KUrl( "media:/" ) );
}
void KonqMainWindow::slotGoNetworkFolders()
{
openURL( 0L, KURL( "remote:/" ) );
openURL( 0L, KUrl( "remote:/" ) );
}
void KonqMainWindow::slotGoSettings()
{
openURL( 0L, KURL( "settings:/" ) );
openURL( 0L, KUrl( "settings:/" ) );
}
void KonqMainWindow::slotGoDirTree()
......@@ -1854,7 +1854,7 @@ void KonqMainWindow::slotGoDirTree()
void KonqMainWindow::slotGoTrash()
{
openURL( 0L, KURL( "trash:/" ) );
openURL( 0L, KUrl( "trash:/" ) );
}
void KonqMainWindow::slotGoAutostart()
......@@ -2538,7 +2538,7 @@ void KonqMainWindow::slotFileNewAboutToShow()
// As requested by KNewMenu :
m_pMenuNew->slotCheckUpToDate();
// And set the files that the menu apply on :
m_pMenuNew->setPopupFiles( KURL( m_currentView->url().url() ) );
m_pMenuNew->setPopupFiles( KUrl( m_currentView->url().url() ) );
}
void KonqMainWindow::slotSplitViewHorizontal()
......@@ -2562,7 +2562,7 @@ void KonqMainWindow::slotAddTab()
false,
KonqSettings::openAfterCurrentPage());
if (newView == 0L) return;
openURL( newView, KURL("about:blank"),QString());
openURL( newView, KUrl("about:blank"),QString());
m_pViewManager->showTab( newView );
focusLocationBar();
m_pWorkingTab = 0L;
......@@ -4073,7 +4073,7 @@ void KonqMainWindow::updateToolBarActions( bool pendingAction /*=false*/)
m_ptaUseHTML->setEnabled( true );
else if ( m_currentView->serviceTypes().contains( "text/html" ) ) {
// Currently viewing an index.html file via this feature (i.e. url points to a dir)
QString locPath = KURL( m_currentView->locationBarURL() ).path();
QString locPath = KUrl( m_currentView->locationBarURL() ).path();
m_ptaUseHTML->setEnabled( QFileInfo( locPath ).isDir() );
} else
m_ptaUseHTML->setEnabled( false );
......@@ -4349,7 +4349,7 @@ void KonqMainWindow::enableAllActions( bool enable )
// So the code below is where actions that should initially be disabled are disabled.
if (enable)
{
setUpEnabled( m_currentView ? m_currentView->url() : KURL() );
setUpEnabled( m_currentView ? m_currentView->url() : KUrl() );
// we surely don't have any history buffers at this time
m_paBack->setEnabled( false );
m_paForward->setEnabled( false );
......@@ -4608,7 +4608,7 @@ void KonqMainWindow::slotPopupMenu( KXMLGUIClient *client, const QPoint &_global
}
else
{
m_popupURL = KURL();
m_popupURL = KUrl();
m_popupServiceType.clear();
}
......@@ -4633,7 +4633,7 @@ void KonqMainWindow::slotPopupMenu( KXMLGUIClient *client, const QPoint &_global
// (This is a bit of a hack for the directory tree....)
// ## should use the new currentView->isHierarchicalView() instead?
// Would this be correct for the konqlistview tree view?
KUrl viewURL = currentView->isToggleView() ? KURL() : currentView->url();
KUrl viewURL = currentView->isToggleView() ? KUrl() : currentView->url();
bool openedForViewURL = false;
//bool dirsSelected = false;
......@@ -5241,7 +5241,7 @@ void KonqMainWindow::setIcon( const QPixmap& pix )
void KonqMainWindow::slotIntro()
{
openURL( 0L, KURL("about:konqueror") );
openURL( 0L, KUrl("about:konqueror") );
}
void KonqMainWindow::goURL()
......
......@@ -108,7 +108,7 @@ public:
enum ComboAction { ComboClear, ComboAdd, ComboRemove };
enum PageSecurity { NotCrypted, Encrypted, Mixed };
KonqMainWindow( const KUrl &initialURL = KURL(), bool openInitialURL = true, const char *name = 0, const QString& xmluiFile="konqueror.rc");
KonqMainWindow( const KUrl &initialURL = KUrl(), bool openInitialURL = true, const char *name = 0, const QString& xmluiFile="konqueror.rc");
~KonqMainWindow();
......
......@@ -79,7 +79,7 @@ KonqMainWindow * KonqMisc::createSimpleWindow( const KUrl & _url, const QString
else
url = _url;
KonqMainWindow *win = new KonqMainWindow( KURL(), false );
KonqMainWindow *win = new KonqMainWindow( KUrl(), false );
win->setInitialFrameName( frameName );
win->openURL( 0L, url );
win->show();
......@@ -94,7 +94,7 @@ KonqMainWindow * KonqMisc::createSimpleWindow( const KUrl & url, const KParts::U
KonqOpenURLRequest req;
req.args = args;
req.tempFile = tempFile;
KonqMainWindow *win = new KonqMainWindow( KURL(), false );
KonqMainWindow *win = new KonqMainWindow( KUrl(), false );
win->openURL( 0L, url, QString(), req );
win->show();
......@@ -153,7 +153,7 @@ KonqMainWindow * KonqMisc::createBrowserWindowFromProfile( const QString &path,
cfg.setGroup( "Profile" );
QString xmluiFile=cfg.readEntry("XMLUIFile","konqueror.rc");
mainWindow = new KonqMainWindow( KURL(), false, 0, xmluiFile );
mainWindow = new KonqMainWindow( KUrl(), false, 0, xmluiFile );
if ( forbidUseHTML )
mainWindow->setShowHTML( false );
KonqOpenURLRequest req;
......
......@@ -86,7 +86,7 @@ public:
*/
static KonqMainWindow * createBrowserWindowFromProfile( const QString &path,
const QString &filename,
const KUrl &url = KURL(),
const KUrl &url = KUrl(),
const KParts::URLArgs &args = KParts::URLArgs(),
bool forbidUseHTML = false,
const QStringList& filesToSelect = QStringList(),
......
......@@ -662,7 +662,7 @@ void KonqView::setIconURL( const KUrl & iconURL )
{
if ( KonqSettings::enableFavicon() )
{
KonqPixmapProvider::setIconForURL( KURL( m_sLocationBarURL ), iconURL );
KonqPixmapProvider::setIconForURL( KUrl( m_sLocationBarURL ), iconURL );
m_bGotIconURL = true;
}
}
......
......@@ -436,7 +436,7 @@ void KonqViewManager::duplicateTab( KonqFrameBase* tab, bool openAfterCurrentPag
// from profile loading (e.g. in switchView)
m_bLoadingProfile = true;
loadItem( config, tabContainer, rootItem, KURL(""), true, openAfterCurrentPage );
loadItem( config, tabContainer, rootItem, KUrl(""), true, openAfterCurrentPage );
m_bLoadingProfile = false;
......@@ -499,7 +499,7 @@ void KonqViewManager::breakOffTab( KonqFrameBase* tab )
config.writeEntry( QString::fromLatin1( "docContainer" ).prepend( prefix ), true );
currentFrame->saveConfig( &config, prefix, true, 0L, 0, 1);
KonqMainWindow *mainWindow = new KonqMainWindow( KURL(), false );
KonqMainWindow *mainWindow = new KonqMainWindow( KUrl(), false );
if (mainWindow == 0L) return;
mainWindow->viewManager()->loadViewProfile( config, "" );
......
......@@ -201,7 +201,7 @@ public:
* settings, they will be reset to the defaults
*/
void loadViewProfile( KConfig &cfg, const QString & filename,
const KUrl & forcedURL = KURL(),
const KUrl & forcedURL = KUrl(),
const KonqOpenURLRequest &req = KonqOpenURLRequest(),
bool resetWindow = false, bool openURL = true );
......@@ -216,7 +216,7 @@ public:
* settings, they will be reset to the defaults
*/
void loadViewProfile( const QString & path, const QString & filename,
const KUrl & forcedURL = KURL(),
const KUrl & forcedURL = KUrl(),
const KonqOpenURLRequest &req = KonqOpenURLRequest(),
bool resetWindow = false, bool openURL = true );
/**
......
......@@ -70,7 +70,7 @@ bool KAutoWebSearch::filterURI( KURIFilterData &data ) const
if ( KURISearchFilterEngine::self()->verbose() )
kDebug () << "Filtered URL: " << result << endl;
setFilteredURI( data, KURL( result ) );
setFilteredURI( data, KUrl( result ) );
setURIType( data, KURIFilterData::NET_PROTOCOL );
return true;
}
......
......@@ -69,7 +69,7 @@ bool KURISearchFilter::filterURI( KURIFilterData &data ) const
if ( KURISearchFilterEngine::self()->verbose() )
kDebug() << "Filtered URL: " << result << endl;
setFilteredURI( data, KURL( result ) );
setFilteredURI( data, KUrl( result ) );
setURIType( data, KURIFilterData::NET_PROTOCOL );
return true;
}
......
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