Logo Search packages:      
Sourcecode: tellico version File versions

bool MainWindow::openURL ( const KURL &  url  )  [private]

Actual method used when opening a URL. Updating for the list views is turned off as well as sorting, in order to more quickly load the document.

Parameters:
url The url to open

Definition at line 1041 of file mainwindow.cpp.

References Tellico::LineEditAction::clear(), slotEnableModifiedActions(), slotEnableOpenedActions(), and slotEntryCount().

Referenced by slotFileOpen(), and slotFileOpenRecent().

                                         {
//  kdDebug() <<  "MainWindow::openURL() - " << url_.prettyURL() << endl;

  // try to open document
  kapp->setOverrideCursor(Qt::waitCursor);
  bool success = Kernel::self()->doc()->openDocument(url_);
  kapp->restoreOverrideCursor();
  if(success) {
    m_quickFilter->clear();
    slotEnableOpenedActions();
    slotEnableModifiedActions(false);
    m_newDocument = false;
  } else if(!m_initialized) {
    // special case on startup when openURL() is called with a command line argument
   // and that URL can't be opened. The window still needs to be initialized
    // the doc object is created with an initial book collection, continue with that
    Controller::self()->slotCollectionAdded(Kernel::self()->collection());

    m_fileSave->setEnabled(false);
    slotEnableOpenedActions();
    slotEnableModifiedActions(false);

    slotEntryCount();
    m_initialized = true;
  }

  return success;
}


Generated by  Doxygen 1.6.0   Back to index