API change of AIFilePicker.

Call AIFilePicker::create() instead of new AIFilePicker.
Renamed deleteMe() to kill() and bs_deleted to bs_killed.
Only default to auto destruct when created with create(true),
otherwise kill() has to be called explicitely.
This commit is contained in:
Aleric Inglewood
2011-05-18 03:52:15 +02:00
parent 4eb87268bd
commit e1fb1fa6b7
23 changed files with 63 additions and 57 deletions

View File

@@ -132,7 +132,7 @@ new AIFilePicker
which sets the state to AIFilePicker_canceled or AIFilePicker_done
respectively, causing a call to AIStateMachine::finish(), which calls
AIFilePicker::finish_impl which destroys the plugin (mPluginBase),
the plugin manager (mPluginManager) and calls AIStateMachine::deleteMe()
the plugin manager (mPluginManager) and calls AIStateMachine::kill()
causing the AIFilePicker to be deleted.
*/
@@ -150,6 +150,9 @@ class AIFilePicker : public AIStateMachine {
public:
AIFilePicker(void);
// Create a dynamically created AIFilePicker object.
static AIFilePicker* create(bool auto_kill = true) { AIFilePicker* filepicker = new AIFilePicker; filepicker->mAutoKill = auto_kill; return filepicker; }
// The starting directory that the user will be in when the file picker opens
// will be the same as the directory used the last time the file picker was
// opened with the same context. If the file picker was never opened before
@@ -184,6 +187,7 @@ private:
typedef std::map<std::string, std::string> context_map_type; //!< Type of mContextMap.
static AIThreadSafeSimple<context_map_type> sContextMap; //!< Map context (ie, "snapshot" or "image") to last used folder.
std::string mContext; //!< Some key to indicate the context (remembers the folder per key).
bool mAutoKill; //!< True if the default behavior is to delete itself after being finished.
// Input variables (cache variable between call to open and run).
open_type mOpenType; //!< Set to whether opening a filepicker to select for saving one file, for loading one file, or loading multiple files.