summaryrefslogtreecommitdiff
path: root/client/resumewidget.cc
diff options
context:
space:
mode:
authordeva <deva>2010-06-01 12:58:32 +0000
committerdeva <deva>2010-06-01 12:58:32 +0000
commit74a28aa7125be6a603128ad600c98c4882f3b5c2 (patch)
tree1a9e4ab74f29d5ff10f2701e4e112f4525c0dcec /client/resumewidget.cc
parent9b9c1e2dd3e5807ff7714b378b03b9ba31f42df7 (diff)
From new_protocol branch.
Diffstat (limited to 'client/resumewidget.cc')
-rw-r--r--client/resumewidget.cc31
1 files changed, 7 insertions, 24 deletions
diff --git a/client/resumewidget.cc b/client/resumewidget.cc
index ae6bec9..ac18578 100644
--- a/client/resumewidget.cc
+++ b/client/resumewidget.cc
@@ -32,10 +32,14 @@
#include <QTextEdit>
#include <QDialog>
+#include <QFont>
+
#define MAX_COMPACT_SIZE 100
//#define RICH // Experimental syntax highlighter (numbers turn blue)
-//#define FIXED_FONT // Show the resume, using a fixed font.
+#define FIXED_FONT // Show the resume, using a fixed font.
+
+extern QFont *fixedfont; // Defined in pracro.cc
ResumeWidget::ResumeWidget(bool compact)
{
@@ -79,24 +83,6 @@ static QString reformatString(QString help)
return output;
}
-#define LONGLINE 100
-static size_t countLongLines(QString str)
-{
- str += "\n"; // Make sure we end at a newline.
- size_t n = 0;
- size_t len = 0;
- for(size_t i = 0; i < (size_t)str.length(); i++) {
- if(str[i] != '\n') {
- len++;
- } else {
- n += len / LONGLINE;
- len = 0;
- }
- }
-
- return n;
-}
-
void ResumeWidget::setText(QString text)
{
QString f;
@@ -104,9 +90,7 @@ void ResumeWidget::setText(QString text)
fulltext = text;
#ifdef FIXED_FONT
- QFont font = resume->font();
- font.setFamily("Courier New");
- resume->setFont(font);
+ resume->setFont(*fixedfont);
#endif
#ifdef RICH
@@ -135,8 +119,7 @@ void ResumeWidget::setText(QString text)
//resume->setWhatsThis(fulltext); // Only set tooltip if resume has actually been cut off.
}
}
- size_t n = countLongLines(f);
- for(size_t i = 0; i < n; i++) f.append('\n');
+
resume->setText(f);
}