| 793 | } |
| 794 | |
| 795 | void DocumentManagerPrivate::setFilePath(const QString &filePath) |
| 796 | { |
| 797 | Q_Q(DocumentManager); |
| 798 | |
| 799 | if (!document->isNew()) { |
| 800 | fileWatcher->removePath(document->filePath()); |
| 801 | } |
| 802 | |
| 803 | document->setFilePath(filePath); |
| 804 | writer->setFileName(filePath); |
| 805 | |
| 806 | if (!filePath.isNull() && !filePath.isEmpty()) { |
| 807 | QFileInfo fileInfo(filePath); |
| 808 | |
| 809 | if (fileInfo.exists()) { |
| 810 | document->setReadOnly(!fileInfo.isWritable()); |
| 811 | } else { |
| 812 | document->setReadOnly(false); |
| 813 | } |
| 814 | } else { |
| 815 | document->setReadOnly(false); |
| 816 | } |
| 817 | |
| 818 | emit q->documentDisplayNameChanged(document->displayName()); |
| 819 | } |
| 820 | |
| 821 | bool DocumentManagerPrivate::checkSaveChanges() |
| 822 | { |
no test coverage detected