Skip to content

Commit

Permalink
Allow to open non-existing files (nickbnf#194)
Browse files Browse the repository at this point in the history
  • Loading branch information
variar committed Sep 24, 2020
1 parent 83686d6 commit 388abef
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/filewatch/src/filewatcher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ class EfswFileWatcher final : public efsw::FileWatchListener {
= WatchedFile{ fileInfo.fileName().toStdString(),
fileInfo.lastModified().toMSecsSinceEpoch(), fileInfo.size() };

const auto directory = fileInfo.canonicalPath().toStdString();
const auto directory = fileInfo.absolutePath().toStdString();

const auto wasEmpty = watchedPaths_.empty();

Expand Down
8 changes: 1 addition & 7 deletions src/ui/src/session.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,7 @@ ViewInterface* Session::getViewIfOpen( const QString& file_name ) const
ViewInterface* Session::open( const QString& file_name,
const std::function<ViewInterface*()>& view_factory )
{
QFileInfo fileInfo( file_name );
if ( fileInfo.isReadable() ) {
return openAlways( file_name, view_factory, nullptr );
}
else {
throw FileUnreadableErr();
}
return openAlways( file_name, view_factory, nullptr );
}

void Session::close( const ViewInterface* view )
Expand Down

0 comments on commit 388abef

Please sign in to comment.