Sophie

Sophie

distrib > Mandriva > current > i586 > media > main-updates > by-pkgid > b77dda48f87d4eda8cc559e40c49a652 > files > 310

python-kde4-doc-4.4.5-0.2mdv2010.2.i586.rpm

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">

<head>
  <title>KSaveFile</title>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <meta http-equiv="Content-Style-Type" content="text/css" />
  <link rel="stylesheet" type="text/css" href="../common/doxygen.css" />
  <link rel="stylesheet" media="screen" type="text/css" title="KDE Colors" href="../common/kde.css" />
</head>
<body>
<div id="container">
<div id="header">
  <div id="header_top">
    <div>
      <div>
        <img alt ="" src="../common/top-kde.jpg"/>
        KDE 4.4 PyKDE API Reference
      </div>
    </div>
  </div>
  <div id="header_bottom">
    <div id="location">
      <ul>
        <li>KDE's Python API</li>
      </ul>
    </div>

    <div id="menu">
      <ul>
        <li><a href="../modules.html">Overview</a></li>
<li><a href="http://techbase.kde.org/Development/Languages/Python">PyKDE Home</a></li>
<li><a href="http://kde.org/family/">Sitemap</a></li>
<li><a href="http://kde.org/contact/">Contact Us</a></li>
</ul>
    </div>
  </div>
</div>

<div id="body_wrapper">
<div id="body">
<div id="right">
<div class="content">
<div id="main">
<div class="clearer">&nbsp;</div>

<h1>KSaveFile Class Reference</h1>
<code>from PyKDE4.kdecore import *</code>
<p>
Inherits: <a href="http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/html/qfile.html">QFile</a> &#x2192; <a href="http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/html/qiodevice.html">QIODevice</a> &#x2192; <a href="http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/html/qobject.html">QObject</a><br />


<h2>Detailed Description</h2>

<p>\class KSaveFile ksavefile.h &lt;KSaveFile&gt;
</p>
<p>
Class to allow for atomic file I/O, as well as utility functions.
</p>
<p>
The KSaveFile class has been made to write out changes to an existing
file atomically. This means that either <b>ALL</b> changes will be written
to the file, or <b>NO</b> changes have been written, and the original file
(if any) has been unchanged. This is useful if you have lots of
time-consuming processing to perform during which an interruption could
occur, or if any error in the file structure will cause the entire file
to be corrupt.
</p>
<p>
When you create a KSaveFile for a given file, a temporary file is instead
created and all your I/O occurs in the save file. Once you call finalize()
the temporary file is renamed to the target file, so that all your changes
happen at once. If abort() is called then the temporary file is removed and
the target file is untouched. KSaveFile derives from QFile so you can use
it just as you would a normal QFile.
</p>
<p>
This class also includes several static utility functions available that
can help ensure data integrity. See the individual functions for details.
</p>
<p>
Here is a quick example of how to use KSaveFile:
</p>
<p>
First we create the KSaveFile and open it.
</p>
<p>
<pre class="fragment">
 KSaveFile saveFile;
 saveFile.setFileName("/lib/foo/bar.dat");
 if ( !saveFile.open() ) {
     //Handle error
 }
</pre>
</p>
<p>
At this point the file "/lib/foo/bar.dat" has not been altered in any way.
Now, let's write out some data to the file.
</p>
<p>
<pre class="fragment">
 QTextStream stream ( &amp;saveFile );
 stream &lt;&lt; "Add some data.";
 // Perform long processing
 stream &lt;&lt; "Add some more data.";
 stream.flush();
</pre>
</p>
<p>
Even after writing this data, the target file "/lib/foo/bar.dat" still has
not been altered in any way. Now that we are done writing our data, we can
write out all the changes that we have made by calling finalize().
</p>
<p>
<pre class="fragment">
 if ( !saveFile.finalize() ) {
     //Handle error
 }
</pre>
</p>
<p>
If a user interruption or error occurred while we were writing out our
changes, we would instead call abort() to cancel all the I/O without
affecting the target file.
</p>
<p>
<dl class="see" compact><dt><b>See also:</b></dt><dd> QFile
</dd></dl> </p>
<p>

<dl class="author" compact><dt><b>Author:</b></dt><dd> Jaison Lee &lt;lee.jaison@gmail.com&gt; </dd></dl>

<dl class="author" compact><dt><b>Author:</b></dt><dd> Waldo Bastian &lt;bastian@kde.org&gt; </dd></dl>
</p>
<table border="0" cellpadding="0" cellspacing="0"><tr><td colspan="2"><br><h2>Methods</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="#KSaveFile">__init__</a> (self)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="#KSaveFile">__init__</a> (self, <a href="http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/html/qstring.html">QString</a> filename, <a href="../kdecore/KComponentData.html">KComponentData</a> componentData=KGlobal.mainComponent())</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="#KSaveFile">__init__</a> (self, <a href="../kdecore/KSaveFile.html">KSaveFile</a> a0)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="#abort">abort</a> (self)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">bool&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="#backupFile">backupFile</a> (self, <a href="http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/html/qstring.html">QString</a> filename, <a href="http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/html/qstring.html">QString</a> backupDir=QString())</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a href="http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/html/qfile::fileerror.html">QFile.FileError</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="#error">error</a> (self)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a href="http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/html/qstring.html">QString</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="#errorString">errorString</a> (self)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a href="http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/html/qstring.html">QString</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="#fileName">fileName</a> (self)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">bool&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="#finalize">finalize</a> (self)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">bool&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="#numberedBackupFile">numberedBackupFile</a> (self, <a href="http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/html/qstring.html">QString</a> filename, <a href="http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/html/qstring.html">QString</a> backupDir=QString(), <a href="http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/html/qstring.html">QString</a> backupExtension=QString.fromLatin1("~"), long maxBackups=10)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">bool&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="#open">open</a> (self, <a href="http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/html/qiodevice::openmode.html">QIODevice.OpenMode</a> flags=QIODevice.ReadWrite)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">bool&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="#rcsBackupFile">rcsBackupFile</a> (self, <a href="http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/html/qstring.html">QString</a> filename, <a href="http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/html/qstring.html">QString</a> backupDir=QString(), <a href="http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/html/qstring.html">QString</a> backupMessage=QString())</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="#setFileName">setFileName</a> (self, <a href="http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/html/qstring.html">QString</a> filename)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">bool&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="#simpleBackupFile">simpleBackupFile</a> (self, <a href="http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/html/qstring.html">QString</a> filename, <a href="http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/html/qstring.html">QString</a> backupDir=QString(), <a href="http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/html/qstring.html">QString</a> backupExtension=QLatin1String("~"))</td></tr>
</table>
<hr><h2>Method Documentation</h2><a class="anchor" name="KSaveFile"></a>
<div class="memitem">
<div class="memproto">
<table class="memname"><tr>
<td class="memname">__init__</td>
<td>(</td>
<td class="paramtype">&nbsp;</td>
<td class="paramname"><em>self</em>&nbsp;)</td>
<td width="100%"> </td>
</tr>
</table>
</div>
<div class="memdoc"><p>Default constructor.
</p></div></div><a class="anchor" name="KSaveFile"></a>
<div class="memitem">
<div class="memproto">
<table class="memname"><tr>
<td class="memname">__init__</td>
<td>(</td>
<td class="paramtype">&nbsp;<em>self</em>, </td>
<td class="paramname"></td>
</tr><tr>
<td class="memname"></td>
<td></td>
<td class="paramtype"><a href="http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/html/qstring.html">QString</a>&nbsp;</td>
<td class="paramname"><em>filename</em>, </td>
</tr>
<tr>
<td class="memname"></td>
<td></td>
<td class="paramtype"><a href="../kdecore/KComponentData.html">KComponentData</a>&nbsp;</td>
<td class="paramname"><em>componentData=KGlobal.mainComponent()</em></td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td>
<td></td>
<td width="100%"> </td>
</tr></table>
</div>
<div class="memdoc"><p>Creates a new KSaveFile and sets the target file to <b>filename.</b>
</p>
<p>
</p><dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td></td><td valign="top"><em>filename</em>&nbsp;</td><td> the path of the file

<tr><td></td><td valign="top"><em>componentData</em>&nbsp;</td><td> The KComponentData to use for the temporary file.
</td></tr>
</table></dl>
<p>
</p></div></div><a class="anchor" name="KSaveFile"></a>
<div class="memitem">
<div class="memproto">
<table class="memname"><tr>
<td class="memname">__init__</td>
<td>(</td>
<td class="paramtype">&nbsp;<em>self</em>, </td>
<td class="paramname"></td>
</tr><tr>
<td class="memname"></td>
<td></td>
<td class="paramtype"><a href="../kdecore/KSaveFile.html">KSaveFile</a>&nbsp;</td>
<td class="paramname"><em>a0</em></td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td>
<td></td>
<td width="100%"> </td>
</tr></table>
</div>
<div class="memdoc"><p>Default constructor.
</p></div></div><a class="anchor" name="abort"></a>
<div class="memitem">
<div class="memproto">
<table class="memname"><tr>
<td class="memname"> abort</td>
<td>(</td>
<td class="paramtype">&nbsp;</td>
<td class="paramname"><em>self</em>&nbsp;)</td>
<td width="100%"> </td>
</tr>
</table>
</div>
<div class="memdoc"><p>Discard changes without affecting the target file.
This will discard all changes that have been made to this file.
The target file will not be altered in any way.
</p></div></div><a class="anchor" name="backupFile"></a>
<div class="memitem">
<div class="memproto">
<table class="memname"><tr>
<td class="memname">bool backupFile</td>
<td>(</td>
<td class="paramtype">&nbsp;<em>self</em>, </td>
<td class="paramname"></td>
</tr><tr>
<td class="memname"></td>
<td></td>
<td class="paramtype"><a href="http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/html/qstring.html">QString</a>&nbsp;</td>
<td class="paramname"><em>filename</em>, </td>
</tr>
<tr>
<td class="memname"></td>
<td></td>
<td class="paramtype"><a href="http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/html/qstring.html">QString</a>&nbsp;</td>
<td class="paramname"><em>backupDir=QString()</em></td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td>
<td></td>
<td width="100%"> </td>
</tr></table>
</div>
<div class="memdoc"><p>Static method to create a backup file before saving.
</p>
<p>
If empty (the default), the backup will be in the same directory as <b>filename.</b>
The backup type (simple, rcs, or numbered), extension string, and maximum
number of backup files are read from the user's global configuration.
Use simpleBackupFile() or numberedBackupFile() to force one of these
specific backup styles.
You can use this method even if you don't use KSaveFile.
</p><dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td></td><td valign="top"><em>filename</em>&nbsp;</td><td> the file to backup

<tr><td></td><td valign="top"><em>backupDir</em>&nbsp;</td><td> optional directory where to save the backup file in.
</td></tr> </table></dl>
<p> <dl class="return" compact><dt><b>Returns:</b></dt><dd> true if successful, or false if an error has occurred.
</dd></dl>
</p></div></div><a class="anchor" name="error"></a>
<div class="memitem">
<div class="memproto">
<table class="memname"><tr>
<td class="memname"><a href="http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/html/qfile::fileerror.html">QFile.FileError</a> error</td>
<td>(</td>
<td class="paramtype">&nbsp;</td>
<td class="paramname"><em>self</em>&nbsp;)</td>
<td width="100%"> </td>
</tr>
</table>
</div>
<div class="memdoc"><p>Returns the last error that occurred.
Use this function to check for errors.
<dl class="return" compact><dt><b>Returns:</b></dt><dd> The last error that occurred, or QFile.NoError.
</dd></dl>
</p></div></div><a class="anchor" name="errorString"></a>
<div class="memitem">
<div class="memproto">
<table class="memname"><tr>
<td class="memname"><a href="http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/html/qstring.html">QString</a> errorString</td>
<td>(</td>
<td class="paramtype">&nbsp;</td>
<td class="paramname"><em>self</em>&nbsp;)</td>
<td width="100%"> </td>
</tr>
</table>
</div>
<div class="memdoc"><p>Returns a human-readable description of the last error.
Use this function to get a human-readable description of the
last error that occurred.
<dl class="return" compact><dt><b>Returns:</b></dt><dd> A string describing the last error that occurred.
</dd></dl>
</p></div></div><a class="anchor" name="fileName"></a>
<div class="memitem">
<div class="memproto">
<table class="memname"><tr>
<td class="memname"><a href="http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/html/qstring.html">QString</a> fileName</td>
<td>(</td>
<td class="paramtype">&nbsp;</td>
<td class="paramname"><em>self</em>&nbsp;)</td>
<td width="100%"> </td>
</tr>
</table>
</div>
<div class="memdoc"><p>Returns the name of the target file.
This function returns the name of the target file, or an empty
QString if it has not yet been set.
<dl class="return" compact><dt><b>Returns:</b></dt><dd> The name of the target file.
</dd></dl>
</p></div></div><a class="anchor" name="finalize"></a>
<div class="memitem">
<div class="memproto">
<table class="memname"><tr>
<td class="memname">bool finalize</td>
<td>(</td>
<td class="paramtype">&nbsp;</td>
<td class="paramname"><em>self</em>&nbsp;)</td>
<td width="100%"> </td>
</tr>
</table>
</div>
<div class="memdoc"><p>Finalize changes to the file.
This will commit all the changes that have been made to the file.
<dl class="return" compact><dt><b>Returns:</b></dt><dd> true if successful, or false if an error has occurred.
</dd></dl>
</p></div></div><a class="anchor" name="numberedBackupFile"></a>
<div class="memitem">
<div class="memproto">
<table class="memname"><tr>
<td class="memname">bool numberedBackupFile</td>
<td>(</td>
<td class="paramtype">&nbsp;<em>self</em>, </td>
<td class="paramname"></td>
</tr><tr>
<td class="memname"></td>
<td></td>
<td class="paramtype"><a href="http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/html/qstring.html">QString</a>&nbsp;</td>
<td class="paramname"><em>filename</em>, </td>
</tr>
<tr>
<td class="memname"></td>
<td></td>
<td class="paramtype"><a href="http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/html/qstring.html">QString</a>&nbsp;</td>
<td class="paramname"><em>backupDir=QString()</em>, </td>
</tr>
<tr>
<td class="memname"></td>
<td></td>
<td class="paramtype"><a href="http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/html/qstring.html">QString</a>&nbsp;</td>
<td class="paramname"><em>backupExtension=QString.fromLatin1("~")</em>, </td>
</tr>
<tr>
<td class="memname"></td>
<td></td>
<td class="paramtype">long&nbsp;</td>
<td class="paramname"><em>maxBackups=10</em></td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td>
<td></td>
<td width="100%"> </td>
</tr></table>
</div>
<div class="memdoc"><p>Static method to create a backup file for a given filename.
</p>
<p>
This function creates a series of numbered backup files from the
given filename.
</p>
<p>
The backup file names will be of the form:
&lt;name&gt;.&lt;number&gt;&lt;extension&gt;
for instance
&lt;pre&gt; chat.3.log &lt;/pre&gt;
</p>
<p>
The new backup file will be have the backup number 1.
Each existing backup file will have its number incremented by 1.
Any backup files with numbers greater than the maximum number
permitted (@p maxBackups) will be removed.
You can use this method even if you don't use KSaveFile.
</p>
<p>
</p><dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td></td><td valign="top"><em>filename</em>&nbsp;</td><td> the file to backup

<tr><td></td><td valign="top"><em>backupDir</em>&nbsp;</td><td> optional directory where to save the backup file in.
If empty (the default), the backup will be in the same directory as
<b>filename.</b>

<tr><td></td><td valign="top"><em>backupExtension</em>&nbsp;</td><td> the extension to append to <b>filename,</b>
which is "~" by default. Do not use an extension containing digits.

<tr><td></td><td valign="top"><em>maxBackups</em>&nbsp;</td><td> the maximum number of backup files permitted.
For best performance a small number (10) is recommended.
</td></tr> </table></dl>
<p> <dl class="return" compact><dt><b>Returns:</b></dt><dd> true if successful, or false if an error has occurred.
</dd></dl>
</p></div></div><a class="anchor" name="open"></a>
<div class="memitem">
<div class="memproto">
<table class="memname"><tr>
<td class="memname">bool open</td>
<td>(</td>
<td class="paramtype">&nbsp;<em>self</em>, </td>
<td class="paramname"></td>
</tr><tr>
<td class="memname"></td>
<td></td>
<td class="paramtype"><a href="http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/html/qiodevice::openmode.html">QIODevice.OpenMode</a>&nbsp;</td>
<td class="paramname"><em>flags=QIODevice.ReadWrite</em></td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td>
<td></td>
<td width="100%"> </td>
</tr></table>
</div>
<div class="memdoc"><p>Open the save file.
This function will open the save file by creating a temporary file to write
to. It will also check to ensure that there are sufficient permissions to
write to the target file.
</p>
<p>
</p><dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td></td><td valign="top"><em>flags</em>&nbsp;</td><td> Sets the QIODevice.OpenMode. It should contain the write flag, otherwise you
have a save file you cannot save to.
</td></tr>
</table></dl>
<p> <dl class="return" compact><dt><b>Returns:</b></dt><dd> true if successful, or false if an error has occurred.
</dd></dl>
</p></div></div><a class="anchor" name="rcsBackupFile"></a>
<div class="memitem">
<div class="memproto">
<table class="memname"><tr>
<td class="memname">bool rcsBackupFile</td>
<td>(</td>
<td class="paramtype">&nbsp;<em>self</em>, </td>
<td class="paramname"></td>
</tr><tr>
<td class="memname"></td>
<td></td>
<td class="paramtype"><a href="http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/html/qstring.html">QString</a>&nbsp;</td>
<td class="paramname"><em>filename</em>, </td>
</tr>
<tr>
<td class="memname"></td>
<td></td>
<td class="paramtype"><a href="http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/html/qstring.html">QString</a>&nbsp;</td>
<td class="paramname"><em>backupDir=QString()</em>, </td>
</tr>
<tr>
<td class="memname"></td>
<td></td>
<td class="paramtype"><a href="http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/html/qstring.html">QString</a>&nbsp;</td>
<td class="paramname"><em>backupMessage=QString()</em></td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td>
<td></td>
<td width="100%"> </td>
</tr></table>
</div>
<div class="memdoc"><p>Static method to create an rcs backup file for a given filename.
</p>
<p>
This function creates a rcs-formatted backup file from the
given filename.
</p>
<p>
The backup file names will be of the form:
&lt;name&gt;,v
for instance
&lt;pre&gt; photo.jpg,v &lt;/pre&gt;
</p>
<p>
The new backup file will be in RCS format.
Each existing backup file will be committed as a new revision.
You can use this method even if you don't use KSaveFile.
</p>
<p>
</p><dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td></td><td valign="top"><em>filename</em>&nbsp;</td><td> the file to backup

<tr><td></td><td valign="top"><em>backupDir</em>&nbsp;</td><td> optional directory where to save the backup file in.
If empty (the default), the backup will be in the same directory as
<b>filename.</b>

<tr><td></td><td valign="top"><em>backupMessage</em>&nbsp;</td><td> is the RCS commit message for this revision.
</td></tr> </table></dl>
<p> <dl class="return" compact><dt><b>Returns:</b></dt><dd> true if successful, or false if an error has occurred.
</dd></dl>
</p></div></div><a class="anchor" name="setFileName"></a>
<div class="memitem">
<div class="memproto">
<table class="memname"><tr>
<td class="memname"> setFileName</td>
<td>(</td>
<td class="paramtype">&nbsp;<em>self</em>, </td>
<td class="paramname"></td>
</tr><tr>
<td class="memname"></td>
<td></td>
<td class="paramtype"><a href="http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/html/qstring.html">QString</a>&nbsp;</td>
<td class="paramname"><em>filename</em></td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td>
<td></td>
<td width="100%"> </td>
</tr></table>
</div>
<div class="memdoc"><p>Set the target filename for the save file.
You must use this to set the filename of the target file if you do
not use the contructor that does so.
</p><dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td></td><td valign="top"><em>filename</em>&nbsp;</td><td> Name of the target file.
</td></tr>
</table></dl>
<p>
</p></div></div><a class="anchor" name="simpleBackupFile"></a>
<div class="memitem">
<div class="memproto">
<table class="memname"><tr>
<td class="memname">bool simpleBackupFile</td>
<td>(</td>
<td class="paramtype">&nbsp;<em>self</em>, </td>
<td class="paramname"></td>
</tr><tr>
<td class="memname"></td>
<td></td>
<td class="paramtype"><a href="http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/html/qstring.html">QString</a>&nbsp;</td>
<td class="paramname"><em>filename</em>, </td>
</tr>
<tr>
<td class="memname"></td>
<td></td>
<td class="paramtype"><a href="http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/html/qstring.html">QString</a>&nbsp;</td>
<td class="paramname"><em>backupDir=QString()</em>, </td>
</tr>
<tr>
<td class="memname"></td>
<td></td>
<td class="paramtype"><a href="http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/html/qstring.html">QString</a>&nbsp;</td>
<td class="paramname"><em>backupExtension=QLatin1String("~")</em></td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td>
<td></td>
<td width="100%"> </td>
</tr></table>
</div>
<div class="memdoc"><p>Static method to create a backup file for a given filename.
</p>
<p>
This function creates a backup file from the given filename.
You can use this method even if you don't use KSaveFile.
</p><dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td></td><td valign="top"><em>filename</em>&nbsp;</td><td> the file to backup

<tr><td></td><td valign="top"><em>backupDir</em>&nbsp;</td><td> optional directory where to save the backup file in.
If empty (the default), the backup will be in the same directory as <b>filename.</b>

<tr><td></td><td valign="top"><em>backupExtension</em>&nbsp;</td><td> the extension to append to <b>filename,</b> "~" by default.
</td></tr> </table></dl>
<p> <dl class="return" compact><dt><b>Returns:</b></dt><dd> true if successful, or false if an error has occurred.
</dd></dl>
</p></div></div>
</div>
</div>
</div>

<div id="left">

<div class="menu_box">
<div class="nav_list">
<ul>
<li><a href="../allclasses.html">Full Index</a></li>
</ul>
</div>

<a name="cp-menu" /><div class="menutitle"><div>
  <h2 id="cp-menu-project">Modules</h2>
</div></div>
<div class="nav_list">
<ul><li><a href="../akonadi/index.html">akonadi</a></li>
<li><a href="../dnssd/index.html">dnssd</a></li>
<li><a href="../kdecore/index.html">kdecore</a></li>
<li><a href="../kdeui/index.html">kdeui</a></li>
<li><a href="../khtml/index.html">khtml</a></li>
<li><a href="../kio/index.html">kio</a></li>
<li><a href="../knewstuff/index.html">knewstuff</a></li>
<li><a href="../kparts/index.html">kparts</a></li>
<li><a href="../kutils/index.html">kutils</a></li>
<li><a href="../nepomuk/index.html">nepomuk</a></li>
<li><a href="../phonon/index.html">phonon</a></li>
<li><a href="../plasma/index.html">plasma</a></li>
<li><a href="../polkitqt/index.html">polkitqt</a></li>
<li><a href="../solid/index.html">solid</a></li>
<li><a href="../soprano/index.html">soprano</a></li>
</ul></div></div>

</div>

</div>
  <div class="clearer"/>
</div>

<div id="end_body"></div>
</div>
<div id="footer"><div id="footer_text">
This documentation is maintained by <a href="&#109;&#97;&#105;&#108;&#116;&#111;&#58;simon&#64;simonzone&#46;com">Simon Edwards</a>.<br />
        KDE<sup>&#174;</sup> and <a href="../images/kde_gear_black.png">the K Desktop Environment<sup>&#174;</sup> logo</a> are registered trademarks of <a href="http://ev.kde.org/" title="Homepage of the KDE non-profit Organization">KDE e.V.</a> |
        <a href="http://www.kde.org/contact/impressum.php">Legal</a>
    </div></div>
</body>
</html>