Skip to content
Permalink
Browse files

Fixed bug 16606 when unable to save the document.

Updated translations.
  • Loading branch information...
matevz committed Jan 17, 2010
1 parent e8b8b6c commit 7f63423b83642f1883b3f5e6ca9bdb42c68cf7c5
Showing with 173 additions and 115 deletions.
  1. +1 −1 .externalToolBuilders/custom_cmake.launch
  2. +32 −20 src/core/file.cpp
  3. +3 −3 src/export/export.cpp
  4. +3 −3 src/import/import.cpp
  5. +111 −87 src/lang/sl.ts
  6. +23 −1 src/ui/mainwin.cpp
@@ -7,5 +7,5 @@
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_RUN_BUILD_KINDS" value="full,incremental,"/>
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_TOOL_ARGUMENTS" value="."/>
<booleanAttribute key="org.eclipse.ui.externaltools.ATTR_TRIGGERS_CONFIGURED" value="true"/>
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_WORKING_DIRECTORY" value="${workspace_loc:/Canorus}"/>
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_WORKING_DIRECTORY" value="${project_loc}"/>
</launchConfiguration>
@@ -53,16 +53,17 @@ CAFile::~CAFile() {
void CAFile::setStreamFromFile( const QString filename ) {
setFile( new QFile( filename ) );

if ( file()->open( QIODevice::ReadOnly ) )
{
if ( file()->open( QIODevice::ReadOnly ) ) {
if(stream() && _deleteStream) {
delete stream();
}
CAFile::setStream( new QTextStream(file()) );
setStream( new QTextStream(file()) );
_deleteStream = true;
}
}

#include <iostream>

/*!
Creates and sets the stream from the file named \a filename.
Stream is Read-Write.
@@ -71,15 +72,14 @@ void CAFile::setStreamFromFile( const QString filename ) {
access QTextStream class, so they call this wrapper instead with a simple string as parameter.
*/
void CAFile::setStreamToFile( const QString filename ) {
if(stream() && _deleteStream)
if (stream() && _deleteStream) {
delete stream();
setStream(0);
}
setFile( new QFile( filename ) );

if ( file()->open( QIODevice::WriteOnly ) ) {
if(stream() && _deleteStream) {
delete stream();
}
CAFile::setStream( new QTextStream(file()) );
setStream( new QTextStream(file()) );
_deleteStream = true;
}
}
@@ -88,28 +88,40 @@ void CAFile::setStreamToFile( const QString filename ) {
Creates and sets the stream from the given device.
Read-write if the given device is not already open.
*/
void CAFile::setStreamToDevice(QIODevice* device)
{
if(stream() && _deleteStream)
void CAFile::setStreamToDevice(QIODevice* device) {
if (stream() && _deleteStream) {
delete stream();
if(!device->isOpen())
setStream(0);
}

if (!device->isOpen()) {
device->open(QIODevice::ReadWrite);
CAFile::setStream(new QTextStream(device));
_deleteStream = true;
}

if (device->isOpen()) {
setStream(new QTextStream(device));
_deleteStream = true;
}
}

/**
Creates and sets the stream from the given device.
Read-only if the device is not already open.
*/
void CAFile::setStreamFromDevice(QIODevice* device)
{
if(stream() && _deleteStream)
void CAFile::setStreamFromDevice(QIODevice* device) {
if (stream() && _deleteStream) {
delete stream();
if(!device->isOpen())
setStream(0);
}

if (!device->isOpen()) {
device->open(QIODevice::ReadOnly);
CAFile::setStream(new QTextStream(device));
_deleteStream = true;
}

if (device->isOpen()) {
CAFile::setStream(new QTextStream(device));
_deleteStream = true;
}
}

/*!
@@ -151,10 +151,10 @@ void CAExport::exportFunctionMarkContext( CAFunctionMarkContext *fmc ) {
const QString CAExport::readableStatus() {
switch (status()) {
case 1:
return tr("Exporting...");
return tr("Exporting");
case 0:
return tr("Ready.");
return tr("Ready");
case -1:
return tr("Data stream not defined.");
return tr("Unable to open file for writing");
}
}
@@ -194,10 +194,10 @@ void CAImport::importFunctionMarkContext() {
const QString CAImport::readableStatus() {
switch (status()) {
case 1:
return tr("Importing...");
return tr("Importing");
case 0:
return tr("Ready.");
return tr("Ready");
case -1:
return tr("File not found or data stream not defined.");
return tr("Unable to open file for reading");
}
}

0 comments on commit 7f63423

Please sign in to comment.
You can’t perform that action at this time.