summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid E. Narvaez <[email protected]>2014-01-01 20:38:16 -0500
committerDavid E. Narvaez <[email protected]>2014-01-14 13:54:09 -0500
commitd0981e40d31f6c6dcc1eddb143d61d8431be7a95 (patch)
treecabc6828cb414aa0c4c01dac1d704385f6dc7df1
parentaf26fb9d9a1415df3141c526c92a472ded28c6bc (diff)
Drop Support for Reporting File Name in Error
This wouldn't make sense if files were loaded from a temporal file location or from memory
-rw-r--r--filters/cabri-filter.cc5
-rw-r--r--filters/cabri-filter.h10
-rw-r--r--filters/cabri-utils.cc13
-rw-r--r--filters/cabri-utils.h3
-rw-r--r--filters/filter.cc6
-rw-r--r--filters/filter.h4
-rw-r--r--filters/kgeo-filter.cc4
-rw-r--r--filters/kgeo-filter.h2
-rw-r--r--filters/native-filter.cc4
9 files changed, 26 insertions, 25 deletions
diff --git a/filters/cabri-filter.cc b/filters/cabri-filter.cc
index 6bd727b..d310993 100644
--- a/filters/cabri-filter.cc
+++ b/filters/cabri-filter.cc
@@ -705,11 +705,6 @@ KigDocument* KigFilterCabri::load( const QString& file )
return ret;
}
-void KigFilterCabri::publicParseError( const QString& file, const QString& text ) const
-{
- parseError( file, text );
-}
-
KigFilterCabri* KigFilterCabri::instance()
{
static KigFilterCabri t;
diff --git a/filters/cabri-filter.h b/filters/cabri-filter.h
index f931dd3..51cccbd 100644
--- a/filters/cabri-filter.h
+++ b/filters/cabri-filter.h
@@ -21,6 +21,8 @@
#include "filter.h"
+class CabriReader;
+
/**
* This is an import filter for the output of the commercial program
* Cabri ("CAhier de BRouillon Interactif" or something like that),
@@ -43,12 +45,8 @@ public:
bool supportMime ( const QString& mime );
KigDocument* load ( const QString& fromfile );
-
- /**
- * \internal
- * Used by the CabriReader to report a parse error dialog to the user.
- */
- void publicParseError( const QString& file, const QString& text ) const;
+
+ friend class CabriReader;
};
#endif
diff --git a/filters/cabri-utils.cc b/filters/cabri-utils.cc
index 7bff84b..b8eba3e 100644
--- a/filters/cabri-utils.cc
+++ b/filters/cabri-utils.cc
@@ -32,7 +32,7 @@
{ \
QString locs = i18n( "An error was encountered at line %1 in file %2.", \
__LINE__, __FILE__ ); \
- m_filter->publicParseError( file, locs ); \
+ parseError( locs ); \
return 0; \
}
@@ -171,6 +171,13 @@ void CabriReader::initColorMap()
}
}
+
+void CabriReader::parseError(const QString& explanation) const
+{
+ m_filter->parseError( explanation );
+}
+
+
QColor CabriReader::translateColor( const QString& s )
{
initColorMap();
@@ -625,7 +632,7 @@ CabriObject* CabriReader_v12::readObject( QFile& f )
freeText = true;
}
else
- readStyles( file, line, myobj );
+ readStyles( line, myobj );
}
line = CabriNS::readLine( f );
@@ -694,7 +701,7 @@ QColor CabriReader_v12::translateColor( const QString& s )
return CabriReader::translateColor( s );
}
-bool CabriReader_v12::readStyles( const QString& file, const QString& line, CabriObject_v12* myobj )
+bool CabriReader_v12::readStyles( const QString& line, CabriObject_v12* myobj )
{
#ifdef CABRI_DEBUG
kDebug() << ">>>>>>>>> style line: \"" << line << "\"";
diff --git a/filters/cabri-utils.h b/filters/cabri-utils.h
index c04ac44..c354337 100644
--- a/filters/cabri-utils.h
+++ b/filters/cabri-utils.h
@@ -125,6 +125,7 @@ protected:
CabriReader( const KigFilterCabri* filter );
static void initColorMap();
+ void parseError( const QString& explanation = QString() ) const;
public:
virtual ~CabriReader();
@@ -156,7 +157,7 @@ class CabriReader_v12
{
private:
static void initColorMap();
- bool readStyles( const QString& file, const QString& s, CabriObject_v12* myobj );
+ bool readStyles( const QString& s, CabriObject_v12* myobj );
public:
CabriReader_v12( const KigFilterCabri* filter );
diff --git a/filters/filter.cc b/filters/filter.cc
index 3c1f6f2..2b15f97 100644
--- a/filters/filter.cc
+++ b/filters/filter.cc
@@ -78,11 +78,11 @@ void KigFilter::fileNotFound( const QString& file ) const
"its permissions", file ) );
}
-void KigFilter::parseError( const QString& file, const QString& explanation ) const
+void KigFilter::parseError( const QString& explanation ) const
{
const QString text =
- i18n( "An error was encountered while parsing the file \"%1\". It "
- "cannot be opened.", file );
+ i18n( "An error was encountered while parsing this file. It "
+ "cannot be opened." );
const QString title = i18n( "Parse Error" );
if ( explanation.isEmpty() )
diff --git a/filters/filter.h b/filters/filter.h
index ddd7ab6..2ca8772 100644
--- a/filters/filter.h
+++ b/filters/filter.h
@@ -54,7 +54,7 @@ protected:
QString locs = i18n( "An error was encountered at " \
"line %1 in file %2.", \
__LINE__, __FILE__ ); \
- parseError( file, locs ); \
+ parseError( locs ); \
return 0; \
}
@@ -69,7 +69,7 @@ class KigFilter
protected:
// shows errors to the user..
void fileNotFound( const QString& file ) const;
- void parseError( const QString& file, const QString& explanation = QString() ) const;
+ void parseError( const QString& explanation = QString() ) const;
void notSupported( const QString& file, const QString& explanation ) const;
void warning( const QString& explanation ) const;
public:
diff --git a/filters/kgeo-filter.cc b/filters/kgeo-filter.cc
index aadf85f..8574495 100644
--- a/filters/kgeo-filter.cc
+++ b/filters/kgeo-filter.cc
@@ -59,7 +59,7 @@ KigDocument* KigFilterKGeo::load( const QString& sFrom )
KConfig config ( sFrom, KConfig::SimpleConfig );
loadMetrics ( &config );
- return loadObjects ( sFrom, &config );
+ return loadObjects ( &config );
}
void KigFilterKGeo::loadMetrics(KConfig* c )
@@ -101,7 +101,7 @@ static std::vector<KGeoHierarchyElement> sortElems( const std::vector<KGeoHierar
return ret;
}
-KigDocument* KigFilterKGeo::loadObjects( const QString& file, KConfig* c )
+KigDocument* KigFilterKGeo::loadObjects( KConfig* c )
{
KigDocument* ret = new KigDocument();
diff --git a/filters/kgeo-filter.h b/filters/kgeo-filter.h
index 07b7b62..98e8b51 100644
--- a/filters/kgeo-filter.h
+++ b/filters/kgeo-filter.h
@@ -44,7 +44,7 @@ protected:
~KigFilterKGeo();
void loadMetrics ( KConfig* );
- KigDocument* loadObjects ( const QString& file, KConfig* );
+ KigDocument* loadObjects ( KConfig* );
int xMax;
int yMax;
diff --git a/filters/native-filter.cc b/filters/native-filter.cc
index 7667ece..010f853 100644
--- a/filters/native-filter.cc
+++ b/filters/native-filter.cc
@@ -299,7 +299,7 @@ KigDocument* KigFilterNative::load04( const QString& file, const QDomElement& do
ObjectImp* imp = ObjectImpFactory::instance()->deserialize( tmp, e, error );
if ( ( !imp ) && !error.isEmpty() )
{
- parseError( file, error );
+ parseError( error );
return 0;
}
o = new ObjectConstCalcer( imp );
@@ -462,7 +462,7 @@ KigDocument* KigFilterNative::load07( const QString& file, const QDomElement& do
ObjectImp* imp = ObjectImpFactory::instance()->deserialize( tmp, e, error );
if ( ( !imp ) && !error.isEmpty() )
{
- parseError( file, error );
+ parseError( error );
return 0;
}
o = new ObjectConstCalcer( imp );