~ubuntu-branches/ubuntu/intrepid/kdebase/intrepid-backports

« back to all changes in this revision

Viewing changes to apps/konqueror/src/konqmainwindow.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Steve Stalcup
  • Date: 2008-10-31 10:55:17 UTC
  • mfrom: (1.1.19 upstream)
  • Revision ID: james.westby@ubuntu.com-20081031105517-62s6t4f2c8j420dy
Tags: 4:4.1.3-0ubuntu1~intrepid1
* New upstream release (LP: #279190, #289832)
* removed following patches completely from debian/patches
  - kubuntu_05_konsole_resize.diff
  - kubuntu_06_fix_cut_copy_context_menu.diff
  - kubuntu_07_fix_KDE_169103_dolphin_crash.diff
  - kubuntu_900_improve_kfind_performance.diff

Show diffs side-by-side

added added

removed removed

Lines of Context:
226
226
  if ( !s_pCompletion ) {
227
227
      s_bookmarkManager = KBookmarkManager::userBookmarksManager();
228
228
 
 
229
      // let the KBookmarkManager know that we are a browser, equals to "keditbookmarks --browser"
 
230
      s_bookmarkManager->setEditorOptions("konqueror", true);
 
231
 
229
232
      KonqHistoryManager* mgr = new KonqHistoryManager(s_bookmarkManager);
230
233
      s_pCompletion = mgr->completionObject();
231
234
 
1008
1011
void KonqMainWindow::openUrlRequestHelper( KonqView *childView, const KUrl &url, const KParts::OpenUrlArguments& args, const KParts::BrowserArguments &browserArgs )
1009
1012
{
1010
1013
    //kDebug(1202) << "url=" << url;
1011
 
  KonqOpenURLRequest req;
1012
 
  req.args = args;
1013
 
  req.browserArgs = browserArgs;
1014
 
 
1015
 
  // Clicking on a link that points to the page itself (e.g. anchor)
1016
 
  if ( !browserArgs.doPost() && !args.reload() &&
1017
 
       childView && !childView->aborted() && // #164495
1018
 
       urlcmp( url.url(), childView->url().url(),
1019
 
               KUrl::CompareWithoutTrailingSlash | KUrl::CompareWithoutFragment ) )
1020
 
  {
1021
 
    QString serviceType = args.mimeType();
1022
 
    if ( serviceType.isEmpty() )
1023
 
      serviceType = childView->serviceType();
1024
 
 
1025
 
    childView->stop();
1026
 
    req.forceAutoEmbed = true;
1027
 
 
1028
 
    req.openAfterCurrentPage = KonqSettings::openAfterCurrentPage();
1029
 
    openView( serviceType, url, childView, req );
1030
 
    return;
1031
 
  }
1032
 
 
1033
 
  openUrl( childView, url, args.mimeType(), req, browserArgs.trustedSource );
 
1014
    KonqOpenURLRequest req;
 
1015
    req.args = args;
 
1016
    req.browserArgs = browserArgs;
 
1017
    openUrl(childView, url, args.mimeType(), req, browserArgs.trustedSource);
1034
1018
}
1035
1019
 
1036
1020
QObject *KonqMainWindow::lastFrame( KonqView *view )
1206
1190
    }
1207
1191
 
1208
1192
    // Pass the URL to createNewWindow so that it can select the right profile for it
 
1193
    // Note that it's always empty in case of window.open, though.
1209
1194
    mainWindow = KonqMisc::createNewWindow(url, args, browserArgs, false, QStringList(), false, false /*do not open URL*/);
1210
1195
    mainWindow->resetAutoSaveSettings(); // Don't autosave
1211
1196
 
1214
1199
    req.browserArgs = browserArgs;
1215
1200
    req.forceAutoEmbed = true;
1216
1201
 
1217
 
    if ( args.mimeType().isEmpty() )
 
1202
    // Do we know the mimetype? If not, go to generic openUrl which will use a KonqRun.
 
1203
    if ( args.mimeType().isEmpty() ) {
1218
1204
      mainWindow->openUrl( 0, url, QString(), req );
1219
 
    else if ( !mainWindow->openView( args.mimeType(), url, 0, req ) )
1220
 
    {
 
1205
    } else if (!mainWindow->openView(args.mimeType(), url, m_currentView, req)) {
1221
1206
      // we have problems. abort.
1222
1207
      delete mainWindow;
1223
1208
 
2039
2024
  // View-dependent GUI
2040
2025
 
2041
2026
  KParts::MainWindow::setCaption( m_currentView->caption() );
2042
 
  m_currentView->frame()->setTitle( m_currentView->caption() , 0);
 
2027
    // This line causes #170470 when removing the current tab, because QTabBar
 
2028
    // emits currentChanged before calling tabRemoved, so KTabWidget gets confused.
 
2029
    // I don't see a need for it anyway...
 
2030
    //m_currentView->frame()->setTitle(m_currentView->caption(), 0);
 
2031
 
2043
2032
  updateOpenWithActions();
2044
2033
  updateViewActions(); // undo, lock, link and other view-dependent actions
2045
2034
  updateViewModeActions();
3003
2992
  connect( m_pURLCompletion, SIGNAL( match(const QString&) ),
3004
2993
           SLOT( slotMatch(const QString&) ));
3005
2994
 
3006
 
  m_combo->lineEdit()->installEventFilter(this);
 
2995
  m_combo->installEventFilter(this);
3007
2996
 
3008
2997
  static bool bookmarkCompletionInitialized = false;
3009
2998
  if ( !bookmarkCompletionInitialized )
3155
3144
bool KonqMainWindow::eventFilter(QObject*obj,QEvent *ev)
3156
3145
{
3157
3146
  if ( ( ev->type()==QEvent::FocusIn || ev->type()==QEvent::FocusOut ) &&
3158
 
       m_combo && m_combo->lineEdit() == obj )
 
3147
       m_combo && m_combo->lineEdit() && m_combo == obj )
3159
3148
  {
3160
3149
    //kDebug(1202) << obj << obj->metaObject()->className() << obj->name();
3161
3150