Changeset 21148 in webkit
- Timestamp:
- Apr 27, 2007 7:55:19 AM (17 years ago)
- Location:
- trunk/WebKitTools
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebKitTools/ChangeLog
r21146 r21148 1 2007-04-27 Nazar Kulyk <schamane@myeburg.net> 2 3 Reviewed by Mark Rowe. 4 5 Basic auto-correction of user-entered URLs. 6 7 * GdkLauncher/main.cpp: 8 (autocorrectURL): 9 (goToURLBarText): 10 (main): 11 1 12 2007-04-28 Mark Rowe <mrowe@apple.com> 2 13 -
trunk/WebKitTools/GdkLauncher/main.cpp
r21146 r21148 28 28 static FrameGdk* gFrame; 29 29 30 static bool stringIsEmpty(const char* str)31 {32 return !str || !*str;33 }34 35 30 static bool stringIsEqual(const char* str1, const char* str2) 36 31 { … … 43 38 } 44 39 40 static String autocorrectURL(const String& url) 41 { 42 String parsedURL = url; 43 if (!url.startsWith("http://") && !url.startsWith("https://") 44 && !url.startsWith("file://") && !url.startsWith("ftp://")) 45 parsedURL = String("http://") + url; 46 return parsedURL; 47 } 48 45 49 static void goToURLBarText(GtkWidget* urlBarEntry) 46 50 { 47 const gchar* url = gtk_entry_get_text(GTK_ENTRY(urlBarEntry));48 if ( stringIsEmpty(url))51 String url(gtk_entry_get_text(GTK_ENTRY(urlBarEntry))); 52 if (url.isEmpty()) 49 53 return; 50 // FIXME: append "http://" if doesn't have a scheme 51 gFrame->loader()->load(url, 0); 54 55 String parsedURL = autocorrectURL(url); 56 gFrame->loader()->load(ResourceRequest(parsedURL)); 52 57 } 53 58 … … 115 120 gtk_init(&argc, &argv); 116 121 117 const char* url = "http://www.google.com";122 String url("http://www.google.com"); 118 123 bool exitAfterLoading = false; 119 124 bool dumpRenderTree = false; … … 135 140 dumpRenderTree = true; 136 141 else 137 url = currArg;142 url = autocorrectURL(currArg); 138 143 } 139 144 … … 203 208 frameView->ScrollView::setDrawable(frameWindow->window); 204 209 205 printf("OPENING URL == %s \n", url); 206 gFrame->loader()->load(ResourceRequest(KURL(url))); 210 gFrame->loader()->load(ResourceRequest(url)); 207 211 gtk_main(); 208 212 #if 0 // FIXME: this crashes at the moment. needs to provide DragClient
Note: See TracChangeset
for help on using the changeset viewer.