Skip to content

Commit

Permalink
More cleanups
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk@9353 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
mhugent committed Sep 19, 2008
1 parent 5239b1e commit 2acb5f5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 105 deletions.
83 changes: 2 additions & 81 deletions src/app/composer/qgscomposer.cpp
Expand Up @@ -834,87 +834,6 @@ void QgsComposer::on_closePButton_clicked()
close();
}

void QgsComposer::projectRead( void )
{
QgsDebugMsg( "entered." );
//if ( mComposition ) delete mComposition;
//mComposition = new QgsComposition( this, 1 );

// Read composition if it is defined in project
QStringList l = QgsProject::instance()->subkeyList( "Compositions", "" );

bool found = false;
for ( QStringList::iterator it = l.begin(); it != l.end(); ++it )
{
QgsDebugMsg( QString( "key: %1" ).arg(( *it ) ) );
if (( *it ).compare( "composition_1" ) == 0 )
{
found = true;
break;
}
}

if ( found )
{
//mComposition->readSettings ( );
mFirstTime = false;
}
else
{
if ( isVisible() )
{
//mComposition->createDefault();
mFirstTime = false;
}
else
{
mFirstTime = true;
}
}

//mComposition->setActive ( true );
}

void QgsComposer::newProject( void )
{
QgsDebugMsg( "entered." );
//if ( mComposition ) delete mComposition;

//mComposition = new QgsComposition( this, 1 );
//mComposition->setActive ( true );

// If composer is visible, create default immediately, otherwise wait for the first open()
if ( isVisible() )
{
//mComposition->createDefault();
mFirstTime = false;
}
else
{
mFirstTime = true;
}
}

bool QgsComposer::writeSettings( void )
{
#ifdef WIN32
bool ok = true;
#else
bool ok = false;
#endif
return ok;
}

bool QgsComposer::readSettings( void )
{
#ifdef WIN32
bool ok = true;
#else
bool ok = false;
#endif
return ok;
}

void QgsComposer::writeXML( QDomDocument& doc )
{
QDomNodeList nl = doc.elementsByTagName( "qgis" );
Expand Down Expand Up @@ -1084,6 +1003,8 @@ void QgsComposer::readXML( const QDomDocument& doc )

mComposition->sortZList();
mView->setComposition( mComposition );

setSelectionTool();
}

void QgsComposer::addComposerMap( QgsComposerMap* map )
Expand Down
24 changes: 0 additions & 24 deletions src/app/composer/qgscomposer.h
Expand Up @@ -41,18 +41,6 @@ class QSizeGrip;

/** \ingroup MapComposer
* \brief A gui for composing a printable map.
* The constructor creates empty composer, without compositions and mFirstTime set to true.
* - if signal projectRead() is received all old compositions are deleted and
* - if the composition exists in project it is created from project settings (mFirstTime set to false)
* - if the composition does not exist in project
* - if the composer is visible new default composition is created (mFirstTime set to false)
* - if the composer is not visible the composer is left empty (mFirstTime set to true)
* - if signal newProject() is received all old compositions are deleted and
* - if the composer is visible a new default composition is created (mFirstTime set to false)
* - if the composer is not visible the composer is left empty (mFirstTime set to true)
*
* If open() is called and mFirstTime == true, a new default composition is created.
*
*/
class QgsComposer: public QMainWindow, private Ui::QgsComposerBase
{
Expand Down Expand Up @@ -80,12 +68,6 @@ class QgsComposer: public QMainWindow, private Ui::QgsComposerBase
//! Show composition options in widget
void showCompositionOptions( QWidget *w );

/** \brief stores statei in project */
bool writeSettings( void );

/** \brief read state from project */
bool readSettings( void );

//! Restore the window and toolbar state
void restoreWindowState();

Expand Down Expand Up @@ -168,12 +150,6 @@ class QgsComposer: public QMainWindow, private Ui::QgsComposerBase
//!Move selected items to bottom
void moveSelectedItemsToBottom();

//! read project
void projectRead();

//! New project
void newProject();

//! Save window state
void saveWindowState();

Expand Down

0 comments on commit 2acb5f5

Please sign in to comment.