Permalink
Browse files

Move cxBundleInfo to separate include.

  • Loading branch information...
1 parent 05f1392 commit ef65f50cd8404df98de4e461bf3b43c3b348e4b4 @adamv adamv committed May 15, 2009
Showing with 34 additions and 19 deletions.
  1. +21 −0 src/BundleInfo.h
  2. +5 −5 src/BundleManager.cpp
  3. +2 −2 src/BundleManager.h
  4. +4 −0 src/e.vcproj
  5. +1 −1 src/plistHandler.cpp
  6. +1 −11 src/plistHandler.h
View
@@ -0,0 +1,21 @@
+#ifndef __BUNDLEINFO_H__
+#define __BUNDLEINFO_H__
+
+#include "wx/wxprec.h"
+#ifndef WX_PRECOMP
+ #include <wx/string.h>
+ #include <wx/datetime.h>
+#endif
+
+class cxBundleInfo {
+public:
+ cxBundleInfo() {};
+ cxBundleInfo(int id, const wxString& name, const wxDateTime& modDate, bool isDisabled=false)
+ : id(id), dirName(name), modDate(modDate), isDisabled(isDisabled) {};
+ int id;
+ wxString dirName;
+ wxDateTime modDate;
+ bool isDisabled;
+};
+
+#endif // __BUNDLEINFO_H__
View
@@ -191,7 +191,7 @@ void BundleManager::AddItems(const wxString& repoName, const vector<cxFileInfo>&
m_bundleList->SetItemData(itemId, (long)&p);
// Check if bundle is installed
- for (vector<PListHandler::cxBundleInfo>::const_iterator b = m_installedBundles.begin(); b != m_installedBundles.end(); ++b) {
+ for (vector<cxBundleInfo>::const_iterator b = m_installedBundles.begin(); b != m_installedBundles.end(); ++b) {
if (b->dirName == p.m_name) {
if (!b->isDisabled) {
// We can't count on the filesystem preserving milliseconds
@@ -276,7 +276,7 @@ void BundleManager::SelectItem(long itemId, bool update) {
// Check if bundle is installed
m_currentBundleState = BDL_NOT_INSTALLED;
m_currentBundleInfo = NULL;
- for (vector<PListHandler::cxBundleInfo>::iterator b = m_installedBundles.begin(); b != m_installedBundles.end(); ++b) {
+ for (vector<cxBundleInfo>::iterator b = m_installedBundles.begin(); b != m_installedBundles.end(); ++b) {
if (b->dirName == name) {
if (b->isDisabled) m_currentBundleState = BDL_DISABLED;
else if (b->modDate == m_currentBundle->m_modDate) m_currentBundleState = BDL_INSTALLED_UPTODATE;
@@ -403,7 +403,7 @@ void BundleManager::OnDeleteButton(wxCommandEvent& WXUNUSED(event)) {
if (m_installedBundles.empty()) return;
// convert pointer to iterator
- vector<PListHandler::cxBundleInfo>::iterator p = m_installedBundles.begin() + (m_currentBundleInfo - &*m_installedBundles.begin());
+ vector<cxBundleInfo>::iterator p = m_installedBundles.begin() + (m_currentBundleInfo - &*m_installedBundles.begin());
if (m_currentBundleInfo->id == -1) {
// We have just installed it, so just delete dir
@@ -484,15 +484,15 @@ bool BundleManager::InstallBundle() {
// Update list
bool inList = false;
- for (vector<PListHandler::cxBundleInfo>::iterator p = m_installedBundles.begin(); p != m_installedBundles.end(); ++p) {
+ for (vector<cxBundleInfo>::iterator p = m_installedBundles.begin(); p != m_installedBundles.end(); ++p) {
if (p->dirName == m_currentBundle->m_name) {
p->modDate = m_currentBundle->m_modDate;
inList = true;
break;
}
}
if (!inList) {
- PListHandler::cxBundleInfo bi(-1, m_currentBundle->m_name, m_currentBundle->m_modDate);
+ cxBundleInfo bi(-1, m_currentBundle->m_name, m_currentBundle->m_modDate);
m_installedBundles.push_back(bi);
}
View
@@ -95,7 +95,7 @@ class BundleManager : public wxDialog {
ITmLoadBundles* m_syntaxHandler;
PListHandler& m_plistHandler;
wxString m_tempFile;
- vector<PListHandler::cxBundleInfo> m_installedBundles;
+ vector<cxBundleInfo> m_installedBundles;
vector<RepoInfo> m_repositories;
bool m_allBundlesReceived;
bool m_needBundleReload;
@@ -105,7 +105,7 @@ class BundleManager : public wxDialog {
long m_currentSel;
wxString m_currentRepo;
const cxFileInfo* m_currentBundle;
- PListHandler::cxBundleInfo* m_currentBundleInfo;
+ cxBundleInfo* m_currentBundleInfo;
BundleState m_currentBundleState;
// Member ctrls
View
@@ -1738,6 +1738,10 @@
>
</File>
<File
+ RelativePath=".\BundleInfo.h"
+ >
+ </File>
+ <File
RelativePath=".\BundleItemEditorCtrl.cpp"
>
</File>
@@ -656,7 +656,7 @@ wxDateTime PListHandler::GetBundleModDate(unsigned int bundleId) const {
return path.GetModificationTime();
}
-vector<PListHandler::cxBundleInfo> PListHandler::GetInstalledBundlesInfo() const {
+vector<cxBundleInfo> PListHandler::GetInstalledBundlesInfo() const {
vector<cxBundleInfo> bInfo;
for (unsigned int i = 0; (int)i < m_vBundles.GetSize(); ++i) {
View
@@ -22,6 +22,7 @@
#include <wx/filename.h>
#include "BundleItemType.h"
+#include "BundleInfo.h"
// STL can't compile with Level 4
#ifdef __WXMSW__
@@ -62,17 +63,6 @@ class PListHandler : public wxEvtHandler {
unsigned int ref;
};
- class cxBundleInfo {
- public:
- cxBundleInfo() {};
- cxBundleInfo(int id, const wxString& name, const wxDateTime& modDate, bool isDisabled=false)
- : id(id), dirName(name), modDate(modDate), isDisabled(isDisabled) {};
- int id;
- wxString dirName;
- wxDateTime modDate;
- bool isDisabled;
- };
-
// Theme lists
void GetThemes(vector<cxItemRef>& themes) const;

0 comments on commit ef65f50

Please sign in to comment.