karbon
vselectiondesc.cc00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #include "vselectiondesc.h"
00021 #include "vselection.h"
00022 #include "vgroup.h"
00023 #include "vtext.h"
00024 #include "vimage.h"
00025 #include "vcomposite.h"
00026 #include <kdebug.h>
00027 #include <klocale.h>
00028
00029 void
00030 VSelectionDescription::visitVSelection( VSelection& selection )
00031 {
00032 if( selection.objects().count() == 1 )
00033 VVisitor::visitVSelection( selection );
00034 else
00035 m_desc = i18n( "One object", "%n objects", selection.objects().count() );
00036 }
00037
00038 void
00039 VSelectionDescription::visitVPath( VPath& composite )
00040 {
00041 m_desc = m_shortdesc = !composite.name().isEmpty() ? composite.name() : i18n( "path" );
00042 }
00043
00044 void
00045 VSelectionDescription::visitVGroup( VGroup &group )
00046 {
00047 m_desc = i18n( "One group, containing one object", "One group, containing %n objects", group.objects().count() );
00048 m_shortdesc = !group.name().isEmpty() ? group.name() : i18n( "group" );
00049 }
00050
00051 void
00052 VSelectionDescription::visitVText( VText &text )
00053 {
00054 m_desc = m_shortdesc = !text.name().isEmpty() ? text.name() : i18n( "text" );
00055 }
00056
00057 void
00058 VSelectionDescription::visitVImage( VImage &img )
00059 {
00060 m_desc = m_shortdesc = !img.name().isEmpty() ? img.name() : i18n( "image" );
00061 }
00062
|