mirror of
				https://github.com/qgis/QGIS.git
				synced 2025-11-04 00:04:25 -05:00 
			
		
		
		
	unload plugins before terminating after taking a snapshot
git-svn-id: http://svn.osgeo.org/qgis/trunk@11168 c8812cc2-4d05-0410-92ff-de0c093fc19c
This commit is contained in:
		
							parent
							
								
									3c01031b16
								
							
						
					
					
						commit
						f112adffef
					
				@ -11,7 +11,7 @@ MACRO (CHECK_GRASS G_PREFIX)
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
  FOREACH (LIB ${GRASS_LIB_NAMES})
 | 
					  FOREACH (LIB ${GRASS_LIB_NAMES})
 | 
				
			||||||
    SET(LIB_PATH NOTFOUND)
 | 
					    SET(LIB_PATH NOTFOUND)
 | 
				
			||||||
    FIND_LIBRARY(LIB_PATH grass_${LIB} PATHS ${G_PREFIX}/lib)
 | 
					    FIND_LIBRARY(LIB_PATH NAMES grass_${LIB} PATHS ${G_PREFIX}/lib NO_DEFAULT_PATH)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    IF (LIB_PATH)
 | 
					    IF (LIB_PATH)
 | 
				
			||||||
      IF (NOT GRASS_LIBRARIES STREQUAL NOTFOUND)
 | 
					      IF (NOT GRASS_LIBRARIES STREQUAL NOTFOUND)
 | 
				
			||||||
 | 
				
			|||||||
@ -34,6 +34,8 @@
 | 
				
			|||||||
#include <QTranslator>
 | 
					#include <QTranslator>
 | 
				
			||||||
#include <QImageReader>
 | 
					#include <QImageReader>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#include "qgspluginregistry.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include <cstdio>
 | 
					#include <cstdio>
 | 
				
			||||||
#include <stdio.h>
 | 
					#include <stdio.h>
 | 
				
			||||||
#include <stdlib.h>
 | 
					#include <stdlib.h>
 | 
				
			||||||
@ -694,7 +696,7 @@ int main( int argc, char *argv[] )
 | 
				
			|||||||
      It looks like you don't run the event loop in non-interactive mode, so the
 | 
					      It looks like you don't run the event loop in non-interactive mode, so the
 | 
				
			||||||
      event is never occuring.
 | 
					      event is never occuring.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      To achieve this without runing the event loop: show the window, then call
 | 
					      To achieve this without running the event loop: show the window, then call
 | 
				
			||||||
      qApp->processEvents(), grab the pixmap, save it, hide the window and exit.
 | 
					      qApp->processEvents(), grab the pixmap, save it, hide the window and exit.
 | 
				
			||||||
      */
 | 
					      */
 | 
				
			||||||
    //qgis->show();
 | 
					    //qgis->show();
 | 
				
			||||||
@ -704,6 +706,9 @@ int main( int argc, char *argv[] )
 | 
				
			|||||||
    qgis->saveMapAsImage( mySnapshotFileName, myQPixmap );
 | 
					    qgis->saveMapAsImage( mySnapshotFileName, myQPixmap );
 | 
				
			||||||
    myApp.processEvents();
 | 
					    myApp.processEvents();
 | 
				
			||||||
    qgis->hide();
 | 
					    qgis->hide();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    QgsPluginRegistry::instance()->unloadAll();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    return 1;
 | 
					    return 1;
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -717,5 +722,4 @@ int main( int argc, char *argv[] )
 | 
				
			|||||||
  mypSplash->finish( qgis );
 | 
					  mypSplash->finish( qgis );
 | 
				
			||||||
  delete mypSplash;
 | 
					  delete mypSplash;
 | 
				
			||||||
  return myApp.exec();
 | 
					  return myApp.exec();
 | 
				
			||||||
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user