View | Details | Raw Unified | Return to bug 17381
Collapse All | Expand All

(-)kiki_src.orig/kiki/src/bots/KikiPlayback.cpp (-2 / +2 lines)
Lines 76-83 void KikiPlayback::start (const std::str Link Here
76
    Controller.world->setCameraMode (atoi ((*iter).substr ((*iter).find (":") + 2).c_str()));
76
    Controller.world->setCameraMode (atoi ((*iter).substr ((*iter).find (":") + 2).c_str()));
77
    iter++;
77
    iter++;
78
78
79
    unsigned int open  = (*iter).find("[")+1;
79
    std::string::size_type open  = (*iter).find("[")+1;
80
    unsigned int close = (*iter).find("]");
80
    std::string::size_type close = (*iter).find("]");
81
    
81
    
82
    std::vector<std::string> values = kStringGetComponents ((*iter).substr(open, close-open), " ");
82
    std::vector<std::string> values = kStringGetComponents ((*iter).substr(open, close-open), " ");
83
    KikiPos pos (atoi(values[0].c_str()), atoi(values[1].c_str()), atoi(values[2].c_str()));
83
    KikiPos pos (atoi(values[0].c_str()), atoi(values[1].c_str()), atoi(values[2].c_str()));
(-)kiki_src.orig/kiki/src/gui/KikiMenu.cpp (-1 / +1 lines)
Lines 69-75 KikiMenuItem * KikiMenu::newItem ( const Link Here
69
{
69
{
70
    std::string item_text (itemText);
70
    std::string item_text (itemText);
71
    std::string event_name (itemText);
71
    std::string event_name (itemText);
72
    unsigned int pos;
72
    std::string::size_type pos;
73
    float scale_factor = 1.0;
73
    float scale_factor = 1.0;
74
74
75
    KikiMenuItem * menu_item = new KikiMenuItem ();
75
    KikiMenuItem * menu_item = new KikiMenuItem ();
(-)kiki_src.orig/kiki/src/gui/KikiTextLine.cpp (-1 / +1 lines)
Lines 46-52 void KikiTextLine::addCharacter ( char c Link Here
46
void KikiTextLine::setText ( const std::string & str )
46
void KikiTextLine::setText ( const std::string & str )
47
{
47
{
48
    text = str;
48
    text = str;
49
    unsigned int pos;
49
    std::string::size_type pos;
50
 
50
 
51
    if ((pos = text.find ("$scale(")) != std::string::npos)
51
    if ((pos = text.find ("$scale(")) != std::string::npos)
52
    {
52
    {
(-)kiki_src.orig/kodilib/src/tools/KFileTools.cpp (-4 / +4 lines)
Lines 117-124 std::string kFileAbsPathName ( const std Link Here
117
// --------------------------------------------------------------------------------------------------------
117
// --------------------------------------------------------------------------------------------------------
118
std::string kFileSuffix ( const std::string & path )
118
std::string kFileSuffix ( const std::string & path )
119
{
119
{
120
    unsigned int lastDotPos = path.rfind(".");
120
    std::string::size_type lastDotPos = path.rfind(".");
121
    unsigned int lastSlashPos = path.rfind("/");
121
    std::string::size_type lastSlashPos = path.rfind("/");
122
122
123
    if (lastDotPos < path.size() - 1 && (lastDotPos > lastSlashPos || lastSlashPos == std::string::npos))
123
    if (lastDotPos < path.size() - 1 && (lastDotPos > lastSlashPos || lastSlashPos == std::string::npos))
124
    {
124
    {
Lines 130-136 std::string kFileSuffix ( const std::str Link Here
130
// --------------------------------------------------------------------------------------------------------
130
// --------------------------------------------------------------------------------------------------------
131
std::string kFileDirName ( const std::string & path )
131
std::string kFileDirName ( const std::string & path )
132
{
132
{
133
    unsigned int lastSlashPos = path.rfind("/");
133
    std::string::size_type lastSlashPos = path.rfind("/");
134
    if (lastSlashPos < path.size())
134
    if (lastSlashPos < path.size())
135
    {
135
    {
136
        return path.substr(0, lastSlashPos+1);
136
        return path.substr(0, lastSlashPos+1);
Lines 142-148 std::string kFileDirName ( const std::st Link Here
142
std::string kFileBaseName ( const std::string & path, bool removeSuffix )
142
std::string kFileBaseName ( const std::string & path, bool removeSuffix )
143
{
143
{
144
    std::string baseName = path;
144
    std::string baseName = path;
145
    unsigned int lastSlashPos = path.rfind("/");
145
    std::string::size_type lastSlashPos = path.rfind("/");
146
    if (lastSlashPos < path.size() - 1) 
146
    if (lastSlashPos < path.size() - 1) 
147
    {
147
    {
148
        baseName = path.substr(lastSlashPos+1);
148
        baseName = path.substr(lastSlashPos+1);
(-)kiki_src.orig/kodilib/src/tools/KKeyTools.cpp (-3 / +3 lines)
Lines 170-176 int kKeyGetDisplayWidthForModifier ( con Link Here
170
// --------------------------------------------------------------------------------------------------------
170
// --------------------------------------------------------------------------------------------------------
171
int kKeyGetDisplayWidthForKey ( const std::string & keyName )
171
int kKeyGetDisplayWidthForKey ( const std::string & keyName )
172
{
172
{
173
    unsigned int keyPos = keyName.find('_', 0);
173
    std::string::size_type keyPos = keyName.find('_', 0);
174
    if (keyPos == std::string::npos) 
174
    if (keyPos == std::string::npos) 
175
    {
175
    {
176
        return kKeyGetDisplayWidthForPureKey(keyName) + KDL_MOD_KEY_SPACING;
176
        return kKeyGetDisplayWidthForPureKey(keyName) + KDL_MOD_KEY_SPACING;
Lines 313-319 int kKeyDisplayPureKey ( const std::stri Link Here
313
int kKeyDisplayKey ( const std::string & keyName, const KPosition & pos )
313
int kKeyDisplayKey ( const std::string & keyName, const KPosition & pos )
314
{
314
{
315
    KPosition start = pos;
315
    KPosition start = pos;
316
    unsigned int keyPos = keyName.find('_', 0);
316
    std::string::size_type keyPos = keyName.find('_', 0);
317
    if (keyPos == std::string::npos) 
317
    if (keyPos == std::string::npos) 
318
    {
318
    {
319
        return start.x + kKeyDisplayPureKey(keyName, start) + KDL_MOD_KEY_SPACING;
319
        return start.x + kKeyDisplayPureKey(keyName, start) + KDL_MOD_KEY_SPACING;
Lines 380-386 SDLMod kKeyGetModForModName ( const std: Link Here
380
// --------------------------------------------------------------------------------------------------------
380
// --------------------------------------------------------------------------------------------------------
381
SDL_keysym kKeyGetKeysymForKeyName ( const std::string & keyName )
381
SDL_keysym kKeyGetKeysymForKeyName ( const std::string & keyName )
382
{
382
{
383
    unsigned int pos = keyName.find('_');
383
    std::string::size_type pos = keyName.find('_');
384
    
384
    
385
    std::string modString;
385
    std::string modString;
386
    std::string symString = keyName;
386
    std::string symString = keyName;
(-)kiki_src.orig/kodilib/src/tools/KStringTools.cpp (-16 / +18 lines)
Lines 12-18 Link Here
12
void kStringInsertStringBehindTags ( std::string & str, const std::string & insertString, 
12
void kStringInsertStringBehindTags ( std::string & str, const std::string & insertString, 
13
                                     const std::string & tag )
13
                                     const std::string & tag )
14
{
14
{
15
    unsigned int oldPos = 0;
15
    std::string::size_type oldPos = 0;
16
    while ((oldPos = str.find(tag, oldPos)) != std::string::npos)
16
    while ((oldPos = str.find(tag, oldPos)) != std::string::npos)
17
    {
17
    {
18
        oldPos += tag.size();
18
        oldPos += tag.size();
Lines 34-40 std::vector<std::string> kStringGetCompo Link Here
34
    std::vector<std::string> components;
34
    std::vector<std::string> components;
35
    
35
    
36
    unsigned int dividerLength = divider.size();
36
    unsigned int dividerLength = divider.size();
37
    unsigned int oldpos = 0, pos;
37
    std::string::size_type oldpos = 0, pos;
38
    
38
    
39
    while ((pos = str.find(divider, oldpos)) != std::string::npos)
39
    while ((pos = str.find(divider, oldpos)) != std::string::npos)
40
    {
40
    {
Lines 49-55 std::vector<std::string> kStringGetCompo Link Here
49
// --------------------------------------------------------------------------------------------------------
49
// --------------------------------------------------------------------------------------------------------
50
void kStringReplace ( std::string & str, const std::string & toReplace, const std::string & replacement )
50
void kStringReplace ( std::string & str, const std::string & toReplace, const std::string & replacement )
51
{
51
{
52
    unsigned int pos = 0, chars = toReplace.size();
52
    std::string::size_type pos = 0;
53
    unsigned int chars = toReplace.size();
53
    while ((pos = str.find(toReplace, pos)) != std::string::npos)
54
    while ((pos = str.find(toReplace, pos)) != std::string::npos)
54
    {
55
    {
55
        str.replace(pos, chars, replacement);
56
        str.replace(pos, chars, replacement);
Lines 59-69 void kStringReplace ( std::string & str, Link Here
59
// --------------------------------------------------------------------------------------------------------
60
// --------------------------------------------------------------------------------------------------------
60
void kStringReplaceTabs ( std::string & str, unsigned int tabWidth )
61
void kStringReplaceTabs ( std::string & str, unsigned int tabWidth )
61
{
62
{
62
    unsigned int tabPos;
63
    std::string::size_type tabPos;
63
    while ((tabPos = str.find('\t')) != std::string::npos)
64
    while ((tabPos = str.find('\t')) != std::string::npos)
64
    {
65
    {
65
        unsigned int lastNewlinePos = str.rfind('\n', tabPos-1);
66
        std::string::size_type lastNewlinePos = str.rfind('\n', tabPos-1);
66
        unsigned int relPos = (lastNewlinePos == std::string::npos) ? tabPos : tabPos - lastNewlinePos; 
67
        std::string::size_type relPos = (lastNewlinePos == std::string::npos) ? tabPos : tabPos - lastNewlinePos; 
67
        str.replace(tabPos, 1, std::string(tabWidth-(relPos % tabWidth), ' '));
68
        str.replace(tabPos, 1, std::string(tabWidth-(relPos % tabWidth), ' '));
68
    }
69
    }
69
}
70
}
Lines 111-119 unsigned int kStringCountChars ( const s Link Here
111
}
112
}
112
113
113
// --------------------------------------------------------------------------------------------------------
114
// --------------------------------------------------------------------------------------------------------
114
unsigned int kStringNthCharPos ( const std::string & str, unsigned int n, char c )
115
std::string::size_type kStringNthCharPos ( const std::string & str, unsigned int n, char c )
115
{
116
{
116
    unsigned int loc = n, oloc = 0;
117
    std::string::size_type loc = n, oloc = 0;
117
    while (n > 0 && (loc = str.find(c, oloc)) != std::string::npos)
118
    while (n > 0 && (loc = str.find(c, oloc)) != std::string::npos)
118
    { 
119
    { 
119
        n--; 
120
        n--; 
Lines 129-135 void kStringCropRows ( std::string & str Link Here
129
    unsigned int lines = kStringRows(str);
130
    unsigned int lines = kStringRows(str);
130
    if (lines > rows)
131
    if (lines > rows)
131
    {
132
    {
132
        unsigned int loc = kStringNthCharPos(str, (lines-rows), '\n');
133
        std::string::size_type loc = kStringNthCharPos(str, (lines-rows), '\n');
133
        str.erase(0, loc+1);
134
        str.erase(0, loc+1);
134
    }
135
    }
135
}
136
}
Lines 137-143 void kStringCropRows ( std::string & str Link Here
137
// --------------------------------------------------------------------------------------------------------
138
// --------------------------------------------------------------------------------------------------------
138
void kStringCropCols ( std::string & str, unsigned int columns )
139
void kStringCropCols ( std::string & str, unsigned int columns )
139
{        
140
{        
140
    unsigned int oloc = 0, nloc = 0;
141
    std::string::size_type oloc = 0, nloc = 0;
141
    while ((nloc = str.find('\n', oloc)) != std::string::npos)
142
    while ((nloc = str.find('\n', oloc)) != std::string::npos)
142
    {
143
    {
143
        if ((nloc - oloc) > columns)
144
        if ((nloc - oloc) > columns)
Lines 159-168 void kStringCropCols ( std::string & str Link Here
159
unsigned int kStringCols ( const std::string & str )
160
unsigned int kStringCols ( const std::string & str )
160
{
161
{
161
    if (str.size() == 0) return 0;
162
    if (str.size() == 0) return 0;
162
    int oloc = 0, nloc;
163
    std::string::size_type oloc = 0, nloc;
163
    std::string substring;
164
    std::string substring;
164
    int maxlength = 0, length;
165
    int maxlength = 0, length;
165
    while ((nloc = str.find('\n', oloc)) != (int)std::string::npos) 
166
    while ((nloc = str.find('\n', oloc)) != std::string::npos) 
166
    {
167
    {
167
        substring = str.substr(oloc, nloc - oloc);
168
        substring = str.substr(oloc, nloc - oloc);
168
        length = substring.size();
169
        length = substring.size();
Lines 180-186 unsigned int kStringCols ( const std::st Link Here
180
unsigned int kStringRows ( const std::string & str )
181
unsigned int kStringRows ( const std::string & str )
181
{
182
{
182
    if (str.size() == 0) return 1;
183
    if (str.size() == 0) return 1;
183
    unsigned int loc = 0, lines = 0;
184
    std::string::size_type loc = 0;
185
    unsigned int lines = 0;
184
    while ((loc = str.find('\n', loc)) != std::string::npos) { lines++; loc++; }
186
    while ((loc = str.find('\n', loc)) != std::string::npos) { lines++; loc++; }
185
    if (str[str.size()-1] == '\n') return lines;
187
    if (str[str.size()-1] == '\n') return lines;
186
    return lines+1;
188
    return lines+1;
Lines 203-210 std::string kStringPrintf ( const std::s Link Here
203
{
205
{
204
    static char str[256];
206
    static char str[256];
205
    std::string format(fmt), subformat, text;
207
    std::string format(fmt), subformat, text;
206
    unsigned int oloc = 0;
208
    std::string::size_type oloc = 0;
207
    unsigned int nloc = 0;
209
    std::string::size_type nloc = 0;
208
    
210
    
209
    kStringReplaceTabs(format);
211
    kStringReplaceTabs(format);
210
    
212
    
Lines 259-265 std::string kStringPrintf ( const char * Link Here
259
// --------------------------------------------------------------------------------------------------------
261
// --------------------------------------------------------------------------------------------------------
260
bool kStringHasSuffix ( const std::string & str, const std::string & suffix )
262
bool kStringHasSuffix ( const std::string & str, const std::string & suffix )
261
{
263
{
262
    unsigned int result = str.rfind(suffix);
264
    std::string::size_type result = str.rfind(suffix);
263
    if (result == std::string::npos) return false;
265
    if (result == std::string::npos) return false;
264
    return (result == str.size()-suffix.size());
266
    return (result == str.size()-suffix.size());
265
}
267
}
(-)kiki_src.orig/kodilib/src/tools/KStringTools.h (-1 / +1 lines)
Lines 23-29 void kStringReplaceTabs ( std::string Link Here
23
std::string	kStringGetSharedPrefix		( const std::vector<std::string> & );
23
std::string	kStringGetSharedPrefix		( const std::vector<std::string> & );
24
void 		kStringCropCols 		( std::string & , unsigned int );
24
void 		kStringCropCols 		( std::string & , unsigned int );
25
void 		kStringCropRows			( std::string & , unsigned int );
25
void 		kStringCropRows			( std::string & , unsigned int );
26
unsigned int	kStringNthCharPos		( const std::string & , unsigned int, char );
26
std::string::size_type	kStringNthCharPos		( const std::string & , unsigned int, char );
27
unsigned int	kStringRows 			( const std::string & );
27
unsigned int	kStringRows 			( const std::string & );
28
unsigned int	kStringCols 			( const std::string & );
28
unsigned int	kStringCols 			( const std::string & );
29
unsigned int	kStringWidth 			( const std::string & , bool = true);
29
unsigned int	kStringWidth 			( const std::string & , bool = true);
(-)kiki_src.orig/kodilib/src/tools/KXMLTools.cpp (-10 / +10 lines)
Lines 57-67 std::string kXMLPrintf ( int depth, cons Link Here
57
std::string kXMLParseToTagsInVector ( std::string & xml, const std::vector<std::string> & tags )
57
std::string kXMLParseToTagsInVector ( std::string & xml, const std::vector<std::string> & tags )
58
{
58
{
59
    std::string open("<");
59
    std::string open("<");
60
    unsigned int minLoc = std::string::npos; 
60
    std::string::size_type minLoc = std::string::npos; 
61
    std::vector<std::string>::const_iterator iter = tags.begin();
61
    std::vector<std::string>::const_iterator iter = tags.begin();
62
    while (iter != tags.end())
62
    while (iter != tags.end())
63
    {
63
    {
64
        unsigned int loc = xml.find(open+(*iter));
64
        std::string::size_type loc = xml.find(open+(*iter));
65
        if (loc < minLoc) minLoc = loc;
65
        if (loc < minLoc) minLoc = loc;
66
        iter++;
66
        iter++;
67
    }
67
    }
Lines 76-82 std::string kXMLReadNamedAttribute ( con Link Here
76
    std::string value;
76
    std::string value;
77
    std::string nameStr(name);
77
    std::string nameStr(name);
78
    nameStr += "='";
78
    nameStr += "='";
79
    unsigned int loc = xml.find(nameStr);
79
    std::string::size_type loc = xml.find(nameStr);
80
    if (loc != std::string::npos)
80
    if (loc != std::string::npos)
81
    {	
81
    {	
82
        loc += nameStr.size();
82
        loc += nameStr.size();
Lines 89-95 std::string kXMLReadNamedAttribute ( con Link Here
89
// --------------------------------------------------------------------------------------------------------
89
// --------------------------------------------------------------------------------------------------------
90
bool kXMLParseNamedCloseTag ( std::string & xml, const std::string & name, bool printError )
90
bool kXMLParseNamedCloseTag ( std::string & xml, const std::string & name, bool printError )
91
{
91
{
92
    unsigned int loc = xml.find('<');
92
    std::string::size_type loc = xml.find('<');
93
    if (loc == std::string::npos) 
93
    if (loc == std::string::npos) 
94
    {
94
    {
95
        if (printError) KConsole::printError(kStringPrintf("invalid XML:\nmissing close tag '%s'", 
95
        if (printError) KConsole::printError(kStringPrintf("invalid XML:\nmissing close tag '%s'", 
Lines 116-122 bool kXMLParseNamedCloseTag ( std::strin Link Here
116
// --------------------------------------------------------------------------------------------------------
116
// --------------------------------------------------------------------------------------------------------
117
bool kXMLReadNamedOpenTag ( const std::string & xml, const std::string & name, std::string * attributes )
117
bool kXMLReadNamedOpenTag ( const std::string & xml, const std::string & name, std::string * attributes )
118
{
118
{
119
    unsigned int loc = xml.find('<'), endloc;
119
    std::string::size_type loc = xml.find('<'), endloc;
120
    
120
    
121
    if (loc == std::string::npos || xml[loc+1] == '/') return false;
121
    if (loc == std::string::npos || xml[loc+1] == '/') return false;
122
    
122
    
Lines 139-145 bool kXMLReadNamedOpenTag ( const std::s Link Here
139
// --------------------------------------------------------------------------------------------------------
139
// --------------------------------------------------------------------------------------------------------
140
std::string kXMLParseNamedOpenTag ( std::string & xml, const std::string & name, std::string * attributes, bool printError )
140
std::string kXMLParseNamedOpenTag ( std::string & xml, const std::string & name, std::string * attributes, bool printError )
141
{
141
{
142
    unsigned int loc = xml.find('<');
142
    std::string::size_type loc = xml.find('<');
143
    if (loc == std::string::npos || xml[loc+1] == '/') 
143
    if (loc == std::string::npos || xml[loc+1] == '/') 
144
    {
144
    {
145
        if (printError) KConsole::printError(kStringPrintf("invalid XML:\nmissing tag '%s'", name.c_str()));
145
        if (printError) KConsole::printError(kStringPrintf("invalid XML:\nmissing tag '%s'", name.c_str()));
Lines 190-196 std::string kXMLParseNamedOpenTag ( std: Link Here
190
// --------------------------------------------------------------------------------------------------------
190
// --------------------------------------------------------------------------------------------------------
191
bool kXMLParseOpenTag ( std::string & xml, std::string & name, std::string * attributes, bool printError )
191
bool kXMLParseOpenTag ( std::string & xml, std::string & name, std::string * attributes, bool printError )
192
{
192
{
193
    unsigned int loc = xml.find('<');
193
    std::string::size_type loc = xml.find('<');
194
    if (loc == std::string::npos || xml[loc+1] == '/') 
194
    if (loc == std::string::npos || xml[loc+1] == '/') 
195
    {
195
    {
196
        if (printError) KConsole::printError("invalid XML:\nmissing open tag");
196
        if (printError) KConsole::printError("invalid XML:\nmissing open tag");
Lines 294-300 std::string kXMLValue( const std::string Link Here
294
// --------------------------------------------------------------------------------------------------------
294
// --------------------------------------------------------------------------------------------------------
295
bool kXMLParseValue( std::string & xml, const std::string & name, int type, void * value, bool printError )
295
bool kXMLParseValue( std::string & xml, const std::string & name, int type, void * value, bool printError )
296
{
296
{
297
    unsigned int loc = xml.find('<');
297
    std::string::size_type loc = xml.find('<');
298
    if (loc == std::string::npos || xml[loc+1] == '/')     
298
    if (loc == std::string::npos || xml[loc+1] == '/')     
299
    {
299
    {
300
        if (printError) KConsole::printError(kStringPrintf("invalid XML:\nmissing value '%s'", name.c_str()));
300
        if (printError) KConsole::printError(kStringPrintf("invalid XML:\nmissing value '%s'", name.c_str()));
Lines 378-385 bool kXMLParseValue( std::string & xml, Link Here
378
        }
378
        }
379
        else if (typeString == "string")
379
        else if (typeString == "string")
380
        {
380
        {
381
            unsigned int first = substring.find("\"")+1;
381
            std::string::size_type first = substring.find("\"")+1;
382
            unsigned int last  = substring.rfind("\"", std::string::npos);
382
            std::string::size_type last  = substring.rfind("\"", std::string::npos);
383
            *((std::string*)value) = substring.substr(first, last-first);
383
            *((std::string*)value) = substring.substr(first, last-first);
384
        }
384
        }
385
        
385
        
(-)kiki_src.orig/kodilib/src/types/KKey.cpp (-2 / +2 lines)
Lines 31-37 KKey::KKey ( std::string keyName ) Link Here
31
// --------------------------------------------------------------------------------------------------------
31
// --------------------------------------------------------------------------------------------------------
32
std::string KKey::getUnmodifiedName () const
32
std::string KKey::getUnmodifiedName () const
33
{
33
{
34
    unsigned int keyPos = name.find('_', 0);
34
    std::string::size_type keyPos = name.find('_', 0);
35
    if (keyPos == std::string::npos) 
35
    if (keyPos == std::string::npos) 
36
    {
36
    {
37
        return name;
37
        return name;
Lines 42-48 std::string KKey::getUnmodifiedName () c Link Here
42
// --------------------------------------------------------------------------------------------------------
42
// --------------------------------------------------------------------------------------------------------
43
std::string KKey::getModifierName () const
43
std::string KKey::getModifierName () const
44
{
44
{
45
    unsigned int keyPos = name.find('_', 0);
45
    std::string::size_type keyPos = name.find('_', 0);
46
    if (keyPos == std::string::npos) 
46
    if (keyPos == std::string::npos) 
47
    {
47
    {
48
        return "";
48
        return "";
(-)kiki_src.orig/kodilib/src/widgets/KFileNameField.cpp (-2 / +2 lines)
Lines 41-47 bool KFileNameField::handleKey ( const K Link Here
41
        std::string restPath; 				 // path behind cursor
41
        std::string restPath; 				 // path behind cursor
42
        
42
        
43
        // map cropped path to current directory and rest path to file prefix
43
        // map cropped path to current directory and rest path to file prefix
44
        unsigned int lastSlashPos = croppedPath.rfind("/");
44
		std::string::size_type lastSlashPos = croppedPath.rfind("/");
45
        if (lastSlashPos < croppedPath.size()-1)
45
        if (lastSlashPos < croppedPath.size()-1)
46
        {
46
        {
47
            restPath = croppedPath.substr(lastSlashPos+1);
47
            restPath = croppedPath.substr(lastSlashPos+1);
Lines 223-229 bool KFileNameField::handleKey ( const K Link Here
223
// --------------------------------------------------------------------------------------------------------
223
// --------------------------------------------------------------------------------------------------------
224
void KFileNameField::selectLastPathComponent ()
224
void KFileNameField::selectLastPathComponent ()
225
{
225
{
226
    unsigned int lastSlashPos = text.rfind("/");
226
    std::string::size_type lastSlashPos = text.rfind("/");
227
    if (lastSlashPos == text.size()-1) lastSlashPos = text.rfind("/", lastSlashPos-1);
227
    if (lastSlashPos == text.size()-1) lastSlashPos = text.rfind("/", lastSlashPos-1);
228
    if (lastSlashPos < text.size()) cursor_pos = lastSlashPos+1;
228
    if (lastSlashPos < text.size()) cursor_pos = lastSlashPos+1;
229
    else cursor_pos = 0;
229
    else cursor_pos = 0;
(-)kiki_src.orig/kodilib/src/widgets/KFileTreeNode.cpp (-1 / +1 lines)
Lines 46-52 KFileTreeNode * KFileTreeNode::getRootNo Link Here
46
// --------------------------------------------------------------------------------------------------------
46
// --------------------------------------------------------------------------------------------------------
47
std::string KFileTreeNode::getSuffix () const
47
std::string KFileTreeNode::getSuffix () const
48
{
48
{
49
    unsigned int pos = name.rfind('.');
49
    std::string::size_type pos = name.rfind('.');
50
    if (pos < name.size()) 
50
    if (pos < name.size()) 
51
    {
51
    {
52
        return name.substr(pos+1);
52
        return name.substr(pos+1);
(-)kiki_src.orig/kodilib/src/widgets/KTextField.cpp (-1 / +1 lines)
Lines 259-265 bool KTextField::handleKey ( const KKey Link Here
259
std::string KTextField::getSelection () const
259
std::string KTextField::getSelection () const
260
{
260
{
261
    if (cursor_pos == selection_pos) return "";
261
    if (cursor_pos == selection_pos) return "";
262
    unsigned int start = kMin(cursor_pos, selection_pos);
262
    std::string::size_type start = kMin(cursor_pos, selection_pos);
263
    return text.substr (start, kMax(cursor_pos, selection_pos)-start);
263
    return text.substr (start, kMax(cursor_pos, selection_pos)-start);
264
}
264
}
265
265
(-)kiki_src.orig/kodilib/src/widgets/KTextWidget.cpp (-2 / +2 lines)
Lines 26-33 void KTextWidget::setLabelText () Link Here
26
    int lineIndex = kStringRows(full_text) - getTextRows();
26
    int lineIndex = kStringRows(full_text) - getTextRows();
27
    if ((int)current_row < lineIndex) lineIndex = current_row;
27
    if ((int)current_row < lineIndex) lineIndex = current_row;
28
    lineIndex = kMax(lineIndex, 0);
28
    lineIndex = kMax(lineIndex, 0);
29
    unsigned int startPos = lineIndex ? kStringNthCharPos(full_text, lineIndex, '\n')+1 : 0;
29
    std::string::size_type startPos = lineIndex ? kStringNthCharPos(full_text, lineIndex, '\n')+1 : 0;
30
    unsigned int endPos   = kStringNthCharPos(full_text, lineIndex + getTextRows(), '\n')+1;
30
    std::string::size_type endPos   = kStringNthCharPos(full_text, lineIndex + getTextRows(), '\n')+1;
31
    setText(full_text.substr(startPos, (endPos - startPos)));
31
    setText(full_text.substr(startPos, (endPos - startPos)));
32
}
32
}
33
33

Return to bug 17381