1.1 --- a/flagobj.cpp Fri May 01 10:30:29 2009 +0000
1.2 +++ b/flagobj.cpp Fri Jul 23 16:43:49 2010 +0000
1.3 @@ -20,6 +20,13 @@
1.4 copy (io);
1.5 }
1.6
1.7 +FlagObj::FlagObj (Flag* f)
1.8 +{
1.9 + init();
1.10 + name=f->getName();
1.11 + icon->load(f->getPixmap());
1.12 +}
1.13 +
1.14 FlagObj::~FlagObj()
1.15 {
1.16 // cout << "Destr FlagObj this="<<this <<" " << qPrintable(name) << "\n";
1.17 @@ -30,27 +37,20 @@
1.18 void FlagObj::init ()
1.19 {
1.20 name="undefined";
1.21 - unsetGroup();
1.22
1.23 icon=new ImageObj (scene);
1.24 icon->setPos (absPos.x(), absPos.y() );
1.25 state=false;
1.26 - used=false;
1.27 avis=true;
1.28 - action=NULL;
1.29 }
1.30
1.31 void FlagObj::copy (FlagObj* other)
1.32 {
1.33 MapObj::copy(other);
1.34 name=other->name;
1.35 - group=other->group;
1.36 - tooltip=other->tooltip;
1.37 state=other->state;
1.38 avis=other->avis;
1.39 - used=other->used;
1.40 icon->copy(other->icon);
1.41 - action=other->action;
1.42 setVisibility (other->isVisibleObj() );
1.43 }
1.44
1.45 @@ -99,51 +99,6 @@
1.46 return name;
1.47 }
1.48
1.49 -void FlagObj::setGroup (const QString &n)
1.50 -{
1.51 - group=n;
1.52 -}
1.53 -
1.54 -const QString FlagObj::getGroup()
1.55 -{
1.56 - return group;
1.57 -}
1.58 -
1.59 -void FlagObj::unsetGroup()
1.60 -{
1.61 - group="undefined";
1.62 -}
1.63 -
1.64 -void FlagObj::setToolTip(const QString &n)
1.65 -{
1.66 - tooltip=n;
1.67 -}
1.68 -
1.69 -const QString FlagObj::getToolTip()
1.70 -{
1.71 - return tooltip;
1.72 -}
1.73 -
1.74 -QPixmap FlagObj::getPixmap()
1.75 -{
1.76 - return icon->pixmap();
1.77 -}
1.78 -
1.79 -void FlagObj::setAction (QAction* a)
1.80 -{
1.81 - action=a;
1.82 -}
1.83 -
1.84 -void FlagObj::updateAction ()
1.85 -{
1.86 - if (action)
1.87 - {
1.88 - action->setChecked(state);
1.89 - if (!avis)
1.90 - action->setVisible(state);
1.91 - }
1.92 -}
1.93 -
1.94 void FlagObj::setAlwaysVisible(bool b)
1.95 {
1.96 avis=b;
1.97 @@ -189,16 +144,6 @@
1.98 }
1.99 }
1.100
1.101 -void FlagObj::setUsed (bool b)
1.102 -{
1.103 - used=b;
1.104 -}
1.105 -
1.106 -bool FlagObj::isUsed()
1.107 -{
1.108 - return used;
1.109 -}
1.110 -
1.111 void FlagObj::saveToDir (const QString &tmpdir, const QString &prefix)
1.112 {
1.113 QString fn=tmpdir + prefix + name + ".png";