MCPcopy Create free account
hub / github.com/KDE/ghostwriter / setFilePath

Method setFilePath

src/documentmanager.cpp:795–819  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

793}
794
795void 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
821bool DocumentManagerPrivate::checkSaveChanges()
822{

Callers 3

renameMethod · 0.45
saveAsMethod · 0.45
closeMethod · 0.45

Calls 6

isNewMethod · 0.80
isNullMethod · 0.80
displayNameMethod · 0.80
filePathMethod · 0.45
setFileNameMethod · 0.45
setReadOnlyMethod · 0.45

Tested by

no test coverage detected