|
From: CVS C. to T. <the...@li...> - 2011-01-09 16:23:37
|
Revision: 599
http://themis.svn.sourceforge.net/themis/?rev=599&view=rev
Author: mark_hellegers
Date: 2011-01-09 16:23:31 +0000 (Sun, 09 Jan 2011)
Log Message:
-----------
- Added BaseEntry class that will be used to store general information about parts of a web page.
- Converted UrlEntry and SiteEntry to use the new BaseEntry class.
- Made small adjustments in other code to make it all work.
This is basically just a straight conversion of the old code, so there is no actual improvement yet.
Modified Paths:
--------------
trunk/themis/framework/SiteEntry.cpp
trunk/themis/framework/SiteEntry.h
trunk/themis/framework/SiteHandler.cpp
trunk/themis/framework/UrlEntry.cpp
trunk/themis/framework/UrlEntry.h
trunk/themis/framework/win.cpp
trunk/themis/makefile
Added Paths:
-----------
trunk/themis/common/BaseEntry.cpp
trunk/themis/common/BaseEntry.hpp
Added: trunk/themis/common/BaseEntry.cpp
===================================================================
--- trunk/themis/common/BaseEntry.cpp (rev 0)
+++ trunk/themis/common/BaseEntry.cpp 2011-01-09 16:23:31 UTC (rev 599)
@@ -0,0 +1,157 @@
+/*
+ Copyright (c) 2011 Mark Hellegers. All Rights Reserved.
+
+ Permission is hereby granted, free of charge, to any person
+ obtaining a copy of this software and associated documentation
+ files (the "Software"), to deal in the Software without
+ restriction, including without limitation the rights to use,
+ copy, modify, merge, publish, distribute, sublicense, and/or
+ sell copies of the Software, and to permit persons to whom
+ the Software is furnished to do so, subject to the following
+ conditions:
+
+ The above copyright notice and this permission notice
+ shall be included in all copies or substantial portions
+ of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
+ KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
+ WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS
+ OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+ Original Author: Mark Hellegers (ma...@fi...)
+ Project Start Date: October 18, 2000
+ Class Start Date: January 08, 2011
+*/
+
+/* BaseEntry implementation
+ See BaseEntry.hpp for more information
+
+*/
+
+// Themis headers
+#include "BaseEntry.hpp"
+
+BaseEntry :: BaseEntry(int32 aId) {
+
+ fId = aId;
+
+}
+
+BaseEntry :: ~BaseEntry() {
+
+ unsigned int size = fChildEntries.size();
+ for (unsigned int i = 0; i < size; i++) {
+ delete fChildEntries[i];
+ }
+
+}
+
+int32 BaseEntry :: getId() const {
+
+ return fId;
+
+}
+
+void BaseEntry :: addEntry(BaseEntry * aEntry) {
+
+ fChildEntries.push_back(aEntry);
+
+}
+
+BaseEntry * BaseEntry :: getEntry(int32 aId) {
+
+ BaseEntry * result = NULL;
+
+ // browse through the entry list to find the UrlEntry with the matching id
+ vector<BaseEntry *>::iterator it = fChildEntries.begin();
+ while (it != fChildEntries.end() && result == NULL) {
+ if (((BaseEntry *)*it)->getId() == aId) {
+ result = *it;
+ }
+ else {
+ it++;
+ }
+ }
+
+ return result;
+}
+
+void BaseEntry :: set(const string aName, const char * aValue) {
+
+ if (mStrings.count(aName) == 0) {
+ mStrings.insert(
+ map<string, string>::value_type(aName, aValue));
+ }
+ else {
+ mStrings[aName] = aValue;
+ };
+}
+
+void BaseEntry :: set(const string aName, const string aValue) {
+
+ if (mStrings.count(aName) == 0) {
+ mStrings.insert(
+ map<string, string>::value_type(aName, aValue));
+ }
+ else {
+ mStrings[aName] = aValue;
+ };
+}
+
+void BaseEntry :: set(const string aName, const bool aValue) {
+
+ if (mBooleans.count(aName) == 0) {
+ mBooleans.insert(
+ map<string, bool>::value_type(aName, aValue));
+ }
+ else {
+ mBooleans[aName] = aValue;
+ };
+}
+
+void BaseEntry :: set(const string aName, const int aValue) {
+
+ if (mIntegers.count(aName) == 0) {
+ mIntegers.insert(
+ map<string, int>::value_type(aName, aValue));
+ }
+ else {
+ mIntegers[aName] = aValue;
+ };
+}
+
+void BaseEntry :: set(const string aName, void * aValue) {
+
+ if (mPointers.count(aName) == 0) {
+ mPointers.insert(
+ map<string, void *>::value_type(aName, aValue));
+ }
+ else {
+ mPointers[aName] = aValue;
+ };
+}
+
+string BaseEntry :: getString(const string aName) {
+
+ return mStrings[aName];
+}
+
+bool BaseEntry :: getBoolean(const string aName) {
+
+ return mBooleans[aName];
+}
+
+int BaseEntry :: getInteger(const string aName) {
+
+ return mIntegers[aName];
+}
+
+void * BaseEntry :: getPointer(const string aName) {
+
+ return mPointers[aName];
+}
Added: trunk/themis/common/BaseEntry.hpp
===================================================================
--- trunk/themis/common/BaseEntry.hpp (rev 0)
+++ trunk/themis/common/BaseEntry.hpp 2011-01-09 16:23:31 UTC (rev 599)
@@ -0,0 +1,86 @@
+/*
+ Copyright (c) 2011 Mark Hellegers. All Rights Reserved.
+
+ Permission is hereby granted, free of charge, to any person
+ obtaining a copy of this software and associated documentation
+ files (the "Software"), to deal in the Software without
+ restriction, including without limitation the rights to use,
+ copy, modify, merge, publish, distribute, sublicense, and/or
+ sell copies of the Software, and to permit persons to whom
+ the Software is furnished to do so, subject to the following
+ conditions:
+
+ The above copyright notice and this permission notice
+ shall be included in all copies or substantial portions
+ of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
+ KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
+ WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS
+ OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+ Original Author: Mark Hellegers (ma...@fi...)
+ Project Start Date: October 18, 2000
+ Class Start Date: January 08, 2011
+*/
+
+/* BaseEntry
+ The basic class for every entry in the system
+
+ Mark Hellegers (ma...@fi...)
+ 08-01-2011
+
+*/
+
+#ifndef BASEENTRY_HPP
+#define BASEENTRY_HPP
+
+// Standard C++ headers
+#include <map>
+#include <string>
+#include <vector>
+
+// BeOS headers
+#include <be/support/SupportDefs.h>
+
+// Namespaces used
+using std::map;
+using std::string;
+using std::vector;
+
+class BaseEntry {
+
+ private:
+ int32 fId;
+
+ map<string, string> mStrings;
+ map<string, bool> mBooleans;
+ map<string, int> mIntegers;
+ map<string, void *> mPointers;
+
+ protected:
+ vector<BaseEntry *> fChildEntries;
+
+ public:
+ BaseEntry(int32 aId);
+ virtual ~BaseEntry();
+ int32 getId() const;
+ void addEntry(BaseEntry * aEntry);
+ BaseEntry * getEntry(int32 aId);
+ void set(const string aName, const char * aValue);
+ void set(const string aName, const string aValue);
+ void set(const string aName, const bool aValue);
+ void set(const string aName, const int aValue);
+ void set(const string aName, void * aValue);
+ string getString(const string aName);
+ bool getBoolean(const string aName);
+ int getInteger(const string aName);
+ void * getPointer(const string aName);
+
+};
+
+#endif
Modified: trunk/themis/framework/SiteEntry.cpp
===================================================================
--- trunk/themis/framework/SiteEntry.cpp 2011-01-09 00:34:48 UTC (rev 598)
+++ trunk/themis/framework/SiteEntry.cpp 2011-01-09 16:23:31 UTC (rev 599)
@@ -13,17 +13,26 @@
#include "SiteEntry.h"
#include "UrlEntry.h"
+// Constants declared
+const string kUrl = "Url";
+const string kTitle = "Title";
+const string kStatusText = "StatusText";
+const string kSecureConnection = "SecureConnection";
+const string kCookiesDisabled = "CookiesDisabled";
+const string kLoadingProgress = "LoadingProgress";
+const string kFavIcon = "FavIcon";
+
SiteEntry :: SiteEntry(int32 id,
- const char* url) {
- fID = id;
- fLoadingProgress = -1;
+ const char * url) : BaseEntry(id) {
+
+ set(kLoadingProgress, -1);
+ set(kUrl, url);
+
+ string statusText = "Transfering data from ";
+ statusText += url;
+ statusText += " ...";
+ set(kStatusText, statusText);
- fUrl = new BString(url);
-
- fStatusText = new BString("Transfering data from ");
- fStatusText->Append(url);
- fStatusText->Append(" ...");
-
/*
* The page title is set to "loading..." now.
* When loading is finished, its set to the sites url.
@@ -32,188 +41,122 @@
* I wait for the renderer to finish, which then delivers me
* the page title.
*/
- fTitle = new BString("loading...");
+ set(kTitle, "loading...");
- fCookiesDisabled = false;
- fSecureConnection = false;
+ set(kSecureConnection, false);
+ set(kCookiesDisabled, false);
- fFavIcon = NULL;
}
-SiteEntry :: ~SiteEntry() {
-
- if (fUrl != NULL)
- delete fUrl;
- if (fStatusText != NULL)
- delete fStatusText;
- if (fTitle != NULL)
- delete fTitle;
-
- unsigned int size = fEntryList.size();
- for (unsigned int i = 0; i < size; i++) {
- delete fEntryList[i];
- }
-
-}
-
-void SiteEntry :: AddEntry(int32 id,
- const char* url) {
-
- UrlEntry* entry = new UrlEntry(id, url);
- fEntryList.push_back(entry);
-
-}
-
bool SiteEntry :: GetCookiesDisabled() {
- return fCookiesDisabled;
+ return getBoolean(kCookiesDisabled);
}
BBitmap * SiteEntry :: GetFavIcon() {
- return fFavIcon;
+ return (BBitmap *) getPointer(kFavIcon);
}
-UrlEntry * SiteEntry :: GetEntry(int32 id) {
+int SiteEntry :: GetLoadingProgress() {
- UrlEntry* entry = NULL;
-
- // browse through the entry list to find the UrlEntry with the matching id
- vector<UrlEntry *>::iterator it = fEntryList.begin();
- while (it != fEntryList.end() && entry == NULL) {
- if (((UrlEntry *)*it)->GetID() == id) {
- entry = *it;
- }
- else {
- it++;
- }
- }
-
- return entry;
-
-}
-
-UrlEntry * SiteEntry :: GetEntry(const char * aUrl) {
-
- UrlEntry * entry = NULL;
- BString urlString = aUrl;
-
- // browse through the entry list to find the UrlEntry with the matching url
- vector<UrlEntry *>::iterator it = fEntryList.begin();
- while (it != fEntryList.end() && entry == NULL) {
- BString listUrlString = ((UrlEntry *)*it)->GetUrl();
- if (urlString == listUrlString) {
- entry = *it;
- }
- else {
- it++;
- }
- }
-
- return entry;
-
-}
-
-int32 SiteEntry :: GetID() {
-
- return fID;
-
-}
-
-int8 SiteEntry :: GetLoadingProgress() {
-
/* cycle through the list of UrlEntries and calculate the loading progress */
- uint32 progress = 0;
- unsigned int nrOfEntries = fEntryList.size();
+ int progress = 0;
+ unsigned int nrOfEntries = fChildEntries.size();
for (unsigned int i = 0; i < nrOfEntries; i++) {
- progress += fEntryList[i]->GetLoadingProgress();
+ UrlEntry * entry = (UrlEntry *) fChildEntries[i];
+ progress += entry->GetLoadingProgress();
}
- progress = (uint32)(progress / nrOfEntries);
- SetLoadingProgress((uint8)progress);
+ progress = (int)(progress / nrOfEntries);
+ SetLoadingProgress(progress);
- return fLoadingProgress;
+ return progress;
}
bool SiteEntry :: GetSecureConnection() {
- return fSecureConnection;
+ return getBoolean(kSecureConnection);
}
const char * SiteEntry :: GetStatusText() {
- return fStatusText ? fStatusText->String() : "";
+ return getString(kStatusText).c_str();
}
const char * SiteEntry :: GetTitle() {
- return fTitle ? fTitle->String() : "";
+ return getString(kTitle).c_str();
}
const char * SiteEntry :: GetUrl() {
- return fUrl ? fUrl->String() : "";
+ return getString(kUrl).c_str();
}
void SiteEntry :: Print() {
printf("------------------------------------\n");
- printf("SiteEntry: ID[%ld] URL[%s] TITLE[%s]\n", fID, fUrl->String(), fTitle->String());
+ printf("SiteEntry: ID[%ld] URL[%s] TITLE[%s]\n", getId(), getString(kUrl).c_str(), getString(kTitle).c_str());
printf(" LoadingProgess[%d] CookiesDisabled[%s], SecureConnection[%s]\n",
- fLoadingProgress,
- fCookiesDisabled ? "true" : "false",
- fSecureConnection ? "true" : "false");
+ getInteger(kLoadingProgress),
+ getBoolean(kCookiesDisabled) ? "true" : "false",
+ getBoolean(kSecureConnection) ? "true" : "false");
- printf(" -- SiteEntrys UrlEntries --\n");
-
- vector<UrlEntry *>::iterator it;
- for (it = fEntryList.begin(); it != fEntryList.end(); it++) {
+ printf(" -- SiteEntry UrlEntries --\n");
+
+ vector<BaseEntry *>::iterator it;
+ for (it = fChildEntries.begin(); it != fChildEntries.end(); it++) {
((UrlEntry *)*it)->Print();
}
+
printf( "------------------------------------\n" );
}
void SiteEntry :: SetCookiesDisabled(bool value) {
- fCookiesDisabled = value;
+ set(kCookiesDisabled, value);
}
void SiteEntry :: SetFavIcon(BBitmap * bmp) {
if (bmp) {
- if (!fFavIcon)
- fFavIcon = new BBitmap(BRect(0, 0, 15, 15), B_RGB32);
- memcpy(fFavIcon->Bits(), bmp->Bits(), 1024);
+ BBitmap * favIcon = GetFavIcon();
+ if (!favIcon) {
+ favIcon = new BBitmap(BRect(0, 0, 15, 15), B_RGB32);
+ set(kFavIcon, favIcon);
+ }
+ memcpy(favIcon->Bits(), bmp->Bits(), 1024);
}
}
-void SiteEntry :: SetLoadingProgress(int8 loadingprogress) {
+void SiteEntry :: SetLoadingProgress(int loadingprogress) {
- fLoadingProgress = loadingprogress;
+ set(kLoadingProgress, loadingprogress);
- if (fLoadingProgress == 100) {
- fStatusText->SetTo("Done.");
- fTitle->SetTo(fUrl->String());
+ if (loadingprogress == 100) {
+ set(kStatusText, "Done.");
+ set(kTitle, getString(kUrl));
}
}
void SiteEntry :: SetSecureConnection(bool value) {
- fSecureConnection = value;
+ set(kSecureConnection, value);
}
-void SiteEntry :: SetTitle(const char* title) {
+void SiteEntry :: SetTitle(const char * title) {
- fTitle->SetTo(title);
+ set(kTitle, title);
}
Modified: trunk/themis/framework/SiteEntry.h
===================================================================
--- trunk/themis/framework/SiteEntry.h 2011-01-09 00:34:48 UTC (rev 598)
+++ trunk/themis/framework/SiteEntry.h 2011-01-09 16:23:31 UTC (rev 599)
@@ -8,51 +8,36 @@
// Standard C++ headers
#include <vector.h>
+// Themis headers
+#include "BaseEntry.hpp"
+
// Namespaces used
using namespace std;
// Declarations used
-class BString;
class BBitmap;
class UrlEntry;
-class SiteEntry {
+class SiteEntry : public BaseEntry {
- private:
- vector<UrlEntry*> fEntryList;
- int32 fID;
- int8 fLoadingProgress;
- BString * fUrl;
- BString * fTitle;
- BString * fStatusText;
- bool fCookiesDisabled;
- bool fSecureConnection;
- BBitmap * fFavIcon;
-
public:
SiteEntry(int32 id,
- const char* url);
- ~SiteEntry();
+ const char * url);
- void AddEntry(int32 id,
- const char* url);
bool GetCookiesDisabled();
BBitmap * GetFavIcon();
- UrlEntry * GetEntry(int32 id);
- UrlEntry * GetEntry(const char * aUrl);
- int32 GetID();
- int8 GetLoadingProgress();
+ int GetLoadingProgress();
bool GetSecureConnection();
const char * GetStatusText();
const char * GetTitle();
const char * GetUrl();
void Print();
void SetCookiesDisabled(bool value);
- void SetFavIcon(BBitmap* bmp);
- void SetLoadingProgress(int8 loadingprogress);
+ void SetFavIcon(BBitmap * bmp);
+ void SetLoadingProgress(int loadingprogress);
void SetSecureConnection(bool value);
- void SetStatusText(const char* text);
- void SetTitle(const char* title);
+ void SetStatusText(const char * text);
+ void SetTitle(const char * title);
};
Modified: trunk/themis/framework/SiteHandler.cpp
===================================================================
--- trunk/themis/framework/SiteHandler.cpp 2011-01-09 00:34:48 UTC (rev 598)
+++ trunk/themis/framework/SiteHandler.cpp 2011-01-09 16:23:31 UTC (rev 599)
@@ -83,7 +83,7 @@
vector< SiteEntry* >::iterator it;
for (it = fEntryList.begin(); it != fEntryList.end(); it++) {
- if (((SiteEntry *)*it)->GetID() == id) {
+ if (((SiteEntry *)*it)->getId() == id) {
entry = *it;
}
}
@@ -98,10 +98,6 @@
SiteEntry * entry = new SiteEntry(aSiteID, aUrl);
fEntryList.push_back(entry);
- /* Get an unique ID from the app */
- int32 urlID = ((App *)be_app)->GetNewID();
- entry->AddEntry(urlID, aUrl);
-
return entry;
}
@@ -217,8 +213,11 @@
printf( "SiteHandler: adding following item: ID[%ld] URL[%s]\n", siteID, url.String() );
SiteEntry * entry = AddEntry(siteID, url.String());
- UrlEntry * urlEntry = entry->GetEntry(url.String());
-
+ /* Get an unique ID from the app */
+ int32 urlID = ((App *)be_app)->GetNewID();
+ UrlEntry * urlEntry = new UrlEntry(urlID, url.String());
+ entry->addEntry(urlEntry);
+
/*
* Inform the protocol(s) to retrieve the site.
* Remember, this is the workaround way, with an url_id > 0.
@@ -227,7 +226,7 @@
BMessage* retrieve = new BMessage(SH_RETRIEVE_START);
retrieve->AddInt32("command", COMMAND_RETRIEVE);
retrieve->AddInt32("site_id", siteID);
- retrieve->AddInt32("url_id", urlEntry->GetID());
+ retrieve->AddInt32("url_id", urlID);
retrieve->AddString("url", url.String());
if (msg->what == SH_RELOAD_PAGE)
retrieve->AddBool("reload", true);
@@ -255,7 +254,7 @@
vector<SiteEntry *>::iterator it;
for (it = fEntryList.begin(); it != fEntryList.end(); it++) {
- if (((SiteEntry *)*it)->GetID() == id) {
+ if (((SiteEntry *)*it)->getId() == id) {
SiteEntry * entry = *(it);
delete entry;
fEntryList.erase(it);
Modified: trunk/themis/framework/UrlEntry.cpp
===================================================================
--- trunk/themis/framework/UrlEntry.cpp 2011-01-09 00:34:48 UTC (rev 598)
+++ trunk/themis/framework/UrlEntry.cpp 2011-01-09 16:23:31 UTC (rev 599)
@@ -5,22 +5,29 @@
// Standard C headers
#include <stdio.h>
+// Standard C++ headers
+#include <string>
+
// BeOS headers
#include <String.h>
// Themis headers
#include "UrlEntry.h"
-UrlEntry::UrlEntry(
- int32 id,
- const char* url )
-{
+// Namespaces used
+using std::string;
+
+// Constants declared
+const string kUrl = "Url";
+const string kTitle = "Title";
+const string kSecureConnection = "SecureConnection";
+const string kLoadingProgress = "LoadingProgress";
+
+UrlEntry :: UrlEntry(int32 id, const char * url) : BaseEntry(id) {
- fID = id;
- fLoadingProgress = -1;
+ set(kLoadingProgress, -1);
+ set(kUrl, url);
- fUrl = new BString( url );
-
/*
* The page title is set to "loading..." now.
* When loading is finished, its set to the sites url.
@@ -29,83 +36,63 @@
* I wait for the renderer to finish, which then delivers me
* the page title.
*/
- fTitle = new BString( "loading..." );
+ set(kTitle, "loading...");
- fSecureConnection = false;
+ set(kSecureConnection, false);
}
-UrlEntry::~UrlEntry()
-{
-
- if( fUrl != NULL )
- delete fUrl;
- if( fTitle != NULL )
- delete fTitle;
-}
+int UrlEntry :: GetLoadingProgress() {
-int32
-UrlEntry::GetID()
-{
- return fID;
-}
+ return getInteger(kLoadingProgress);
-int8
-UrlEntry::GetLoadingProgress()
-{
- return fLoadingProgress;
}
-bool
-UrlEntry::GetSecureConnection()
-{
- return fSecureConnection;
+bool UrlEntry :: GetSecureConnection() {
+
+ return getBoolean(kSecureConnection);
+
}
-const char*
-UrlEntry::GetTitle()
-{
- return fTitle ? fTitle->String() : "";
+const char * UrlEntry :: GetTitle() {
+
+ return getString(kTitle).c_str();
+
}
-const char*
-UrlEntry::GetUrl()
-{
- return fUrl ? fUrl->String() : "";
+const char * UrlEntry :: GetUrl() {
+
+ return getString(kUrl).c_str();
+
}
-void
-UrlEntry::Print()
-{
- printf( " URLENTRY: ID[%ld] URL[%s] TITLE[%s]\n", fID, fUrl->String(), fTitle->String() );
+void UrlEntry :: Print() {
+
+ printf( " URLENTRY: ID[%ld] URL[%s] TITLE[%s]\n", getId(), getString(kUrl).c_str(), getString(kTitle).c_str());
printf( " LoadingProgess[%d] SecureConnection[%s]\n",
- fLoadingProgress,
- fSecureConnection ? "true" : "false" );
+ getInteger(kLoadingProgress),
+ getBoolean(kSecureConnection) ? "true" : "false" );
}
-void
-UrlEntry::SetLoadingProgress(
- int8 loadingprogress )
-{
- fLoadingProgress = loadingprogress;
+void UrlEntry :: SetLoadingProgress(int loadingprogress) {
+
+ set(kLoadingProgress, loadingprogress);
- if( fLoadingProgress == 100 )
- {
- fTitle->SetTo( fUrl->String() );
+ if (loadingprogress == 100) {
+ set(kTitle, getString(kUrl));
}
+
}
-void
-UrlEntry::SetSecureConnection(
- bool value )
-{
- fSecureConnection = value;
+void UrlEntry :: SetSecureConnection(bool value) {
+
+ set(kSecureConnection, value);
+
}
-void
-UrlEntry::SetTitle(
- const char* title )
-{
- fTitle->SetTo( title );
+void UrlEntry :: SetTitle(const char* title) {
+
+ set(kTitle, title);
+
}
Modified: trunk/themis/framework/UrlEntry.h
===================================================================
--- trunk/themis/framework/UrlEntry.h 2011-01-09 00:34:48 UTC (rev 598)
+++ trunk/themis/framework/UrlEntry.h 2011-01-09 16:23:31 UTC (rev 599)
@@ -5,31 +5,21 @@
#ifndef URLENTRY_H
#define URLENTRY_H
-// Declarations used
-class BString;
+#include "BaseEntry.hpp"
-class UrlEntry {
+class UrlEntry : public BaseEntry {
- private:
- int32 fID;
- int8 fLoadingProgress;
- BString * fUrl;
- BString * fTitle;
- bool fSecureConnection;
-
public:
UrlEntry(int32 id,
- const char* url);
- ~UrlEntry();
+ const char * url);
- int32 GetID();
- int8 GetLoadingProgress();
+ int GetLoadingProgress();
bool GetSecureConnection();
const char * GetTitle();
const char * GetUrl();
void Print();
- void SetLoadingProgress(int8 loadingprogress);
+ void SetLoadingProgress(int loadingprogress);
void SetSecureConnection(bool value);
void SetTitle(const char * title);
Modified: trunk/themis/framework/win.cpp
===================================================================
--- trunk/themis/framework/win.cpp 2011-01-09 00:34:48 UTC (rev 598)
+++ trunk/themis/framework/win.cpp 2011-01-09 16:23:31 UTC (rev 599)
@@ -984,7 +984,7 @@
if (site_entry != NULL) {
int32 url_id = 0;
message->FindInt32("url_id", &url_id);
- url_entry = site_entry->GetEntry(url_id);
+ url_entry = (UrlEntry *) site_entry->getEntry(url_id);
if (url_entry != NULL) {
int64 content_length = 0;
Modified: trunk/themis/makefile
===================================================================
--- trunk/themis/makefile 2011-01-09 00:34:48 UTC (rev 598)
+++ trunk/themis/makefile 2011-01-09 16:23:31 UTC (rev 599)
@@ -117,7 +117,8 @@
common/cacheobject.cpp \
common/stripwhite.cpp \
common/TTextView.cpp \
- common/BasePrefsView.cpp
+ common/BasePrefsView.cpp \
+ common/BaseEntry.cpp
#add similar lines for new plugins, libraries, etc.
HTTPADDONSOURCES= \
http/optionshandler.cpp \
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|