Update of /cvsroot/mahogany/M/src/adb
In directory sc8-pr-cvs1:/tmp/cvs-serv9821/src/adb
Modified Files:
ProvFC.cpp
Log Message:
don't flush ADB in IsReadOnly() test, just assume that it is writable if the file
doesn't exist
Index: ProvFC.cpp
===================================================================
RCS file: /cvsroot/mahogany/M/src/adb/ProvFC.cpp,v
retrieving revision 1.43
retrieving revision 1.44
diff -b -u -2 -r1.43 -r1.44
--- ProvFC.cpp 1 Oct 2003 23:22:00 -0000 1.43
+++ ProvFC.cpp 2 Oct 2003 16:48:53 -0000 1.44
@@ -745,12 +745,8 @@
bool FCBook::IsReadOnly() const
{
- // flush config forcing the file creation, otherwise our we would always
- // return true because wxFile::Access() fails for non existing file!
- if ( !wxFile::Exists(m_strFile) )
- {
- m_pConfig->Flush();
- }
-
- return !wxFile::Access(m_strFile, wxFile::write);
+ // if the file doesn't exist yet, we can't use Access() (it would return
+ // false) but we can be sure that we're not read only as a new book can be
+ // successfully opened with a non existing file name only for writing
+ return wxFile::Exists(m_strFile) && !wxFile::Access(m_strFile, wxFile::write);
}
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Mahogany-cvsupdates mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/mahogany-cvsupdates