Changeset View
Changeset View
Standalone View
Standalone View
libs/main/KoMainWindow.cpp
Show First 20 Lines • Show All 768 Lines • ▼ Show 20 Line(s) | 744 | { | |||
---|---|---|---|---|---|
769 | } | 769 | } | ||
770 | updateReloadFileAction(newdoc); | 770 | updateReloadFileAction(newdoc); | ||
771 | updateVersionsFileAction(newdoc); | 771 | updateVersionsFileAction(newdoc); | ||
772 | 772 | | |||
773 | KFileItem file(url, newdoc->mimeType(), KFileItem::Unknown); | 773 | KFileItem file(url, newdoc->mimeType(), KFileItem::Unknown); | ||
774 | if (!file.isWritable()) { | 774 | if (!file.isWritable()) { | ||
775 | setReadWrite(false); | 775 | setReadWrite(false); | ||
776 | } | 776 | } | ||
777 | | ||||
777 | return true; | 778 | return true; | ||
778 | } | 779 | } | ||
779 | 780 | | |||
780 | // Separate from openDocument to handle async loading (remote URLs) | 781 | // Separate from openDocument to handle async loading (remote URLs) | ||
781 | void KoMainWindow::slotLoadCompleted() | 782 | void KoMainWindow::slotLoadCompleted() | ||
782 | { | 783 | { | ||
783 | debugMain << "KoMainWindow::slotLoadCompleted"; | 784 | debugMain << "KoMainWindow::slotLoadCompleted"; | ||
784 | KoDocument *newdoc = qobject_cast<KoDocument*>(sender()); | 785 | KoDocument *newdoc = qobject_cast<KoDocument*>(sender()); | ||
Show All 9 Lines | 791 | } else if (d->rootDocument && !d->rootDocument->isEmpty()) { | |||
794 | KoMainWindow *s = newpart->createMainWindow(); | 795 | KoMainWindow *s = newpart->createMainWindow(); | ||
795 | s->show(); | 796 | s->show(); | ||
796 | newpart->removeMainWindow(this); | 797 | newpart->removeMainWindow(this); | ||
797 | s->setRootDocument(newdoc, newpart); | 798 | s->setRootDocument(newdoc, newpart); | ||
798 | } else { | 799 | } else { | ||
799 | // We had no document, set the new one | 800 | // We had no document, set the new one | ||
800 | setRootDocument(newdoc); | 801 | setRootDocument(newdoc); | ||
801 | } | 802 | } | ||
803 | | ||||
802 | slotProgress(-1); | 804 | slotProgress(-1); | ||
803 | disconnect(newdoc, SIGNAL(sigProgress(int)), this, SLOT(slotProgress(int))); | 805 | disconnect(newdoc, SIGNAL(sigProgress(int)), this, SLOT(slotProgress(int))); | ||
804 | disconnect(newdoc, SIGNAL(completed()), this, SLOT(slotLoadCompleted())); | 806 | disconnect(newdoc, SIGNAL(completed()), this, SLOT(slotLoadCompleted())); | ||
805 | disconnect(newdoc, SIGNAL(canceled(QString)), this, SLOT(slotLoadCanceled(QString))); | 807 | disconnect(newdoc, SIGNAL(canceled(QString)), this, SLOT(slotLoadCanceled(QString))); | ||
806 | d->openingDocument = false; | 808 | d->openingDocument = false; | ||
807 | emit loadCompleted(); | 809 | emit loadCompleted(); | ||
808 | } | 810 | } | ||
809 | 811 | | |||
▲ Show 20 Lines • Show All 1365 Lines • Show Last 20 Lines |