kuser.h
true
false
false
false
false
false
false
false
false
QStringList drawingTools;
// load the default tool list from the 'xml tools definition' file
QFile infoDrawingFile( QStandardPaths::locate(QStandardPaths::GenericDataLocation, "okular/drawingtools.xml") );
if ( infoDrawingFile.exists() && infoDrawingFile.open( QIODevice::ReadOnly ) )
{
QDomDocument doc;
if ( doc.setContent( &infoDrawingFile ) )
{
const QDomElement toolsDefinition = doc.elementsByTagName("drawingTools").item( 0 ).toElement();
// create the annotationTools list from the XML dom tree
QDomNode toolDescription = toolsDefinition.firstChild();
while ( toolDescription.isElement() )
{
const QDomElement toolElement = toolDescription.toElement();
if ( toolElement.tagName() == "tool" )
{
QDomDocument temp;
temp.appendChild( temp.importNode( toolElement, true) );
// add each <tool>...</tool> as XML string
drawingTools << temp.toString(-1);
}
toolDescription = toolDescription.nextSibling();
}
}
else
{
qWarning() << "DrawingTools XML file seems to be damaged";
}
}
else
{
qWarning() << "Unable to open DrawingTools XML definition";
}
drawingTools
QStringList annotationTools;
// load the default tool list from the 'xml tools definition' file
QFile infoFile( QStandardPaths::locate(QStandardPaths::GenericDataLocation, "okular/tools.xml") );
if ( infoFile.exists() && infoFile.open( QIODevice::ReadOnly ) )
{
QDomDocument doc;
if ( doc.setContent( &infoFile ) )
{
QDomElement toolsDefinition = doc.elementsByTagName("annotatingTools").item( 0 ).toElement();
// create the annotationTools list from the XML dom tree
QDomNode toolDescription = toolsDefinition.firstChild();
while ( toolDescription.isElement() )
{
QDomElement toolElement = toolDescription.toElement();
if ( toolElement.tagName() == "tool" )
{
QDomDocument temp;
temp.appendChild( temp.importNode( toolElement, true) );
// add each <tool>...</tool> as XML string
annotationTools << temp.toString(-1);
}
toolDescription = toolDescription.nextSibling();
}
}
else
{
qWarning() << "AnnotatingTools XML file seems to be damaged";
}
}
else
{
qWarning() << "Unable to open AnnotatingTools XML definition";
}
annotationTools
1
3
false
true
true
false
Name
true
Qt::black
Replace
HiddenDelay
true
false
true
-2
-2
20
true
true
false
true
true
false
true
true
true
48
0
true
0
0
50
3
1
8
false
true
Single
None
Browse
false
false
false
true
true
false
false
0x600000
0xF0F0F0
127
2
253
2
2
6
KUser currentUser;
QString userString = currentUser.property( KUser::FullName ).toString();
if ( userString.isEmpty() )
{
userString = currentUser.loginName();
}
userString